In T263298 one of the issue at play is that you can't provide a baserevid to Wikibase API endpoints to create a mediainfo entity, if it didn't already exist.
This is discovered and confirmed in T263298#6494034
> When a file on commons does not get have a media info entity attached to itCurrently, you can not use a baserevid in Wikibase API calls
> This is a small issue with the MCR integration that someone will need to tackle for the edit conflict rules to be able to work in all cases.
The issue identified in the ticket is with the `wbsetclaim` API,users of the Wikimedia Commons action API cannot create new `MediaInfo` entity on an existing commons page through the Wikibase interface while using the page's baserevid. but this likely affects ALL apis when used in this mode.
When Wikibase is being used with an MCR enabled entity type
And the page for the entity already exists
And the page has a revision ID
And the relevant entity does not yet exist (no media info entity yet)
Then the API should allow use of the latest page id with the baserevid parameter (throughout the API)An investigation is required to determine how to make this possible.
Although the bug is likely in Wikibase or MediaWiki the MediaInfo extension will be greatly benficial when debugging as it is the only entity type currently setup to work with MCRs a Wikimedia Commons action API user, I would like to be able to create a new `MediaInfo` entity on an existing commons page through the Wikibase interface while using the page's baserevid so that I can avoid edit conflicts while using a standard interface.
**Reproduction:**
-# Upload a new file (and do NOT add any structured data)
-# Use `wbsetclaim` to add a statement and set the baserevid to the latest page revsiionrevision
-# Receive an error
Expected outcome: the edit would be allowed
**Current outcome:Behavior**:
The request results in an error:
```lang=json,counterexample
{
"errors": [
{
"code": "nosuchrevid",
"text": "Revision with ID not found.",
"data": {
"messages": [
{
"name": "wikibase-api-nosuchrevid",
"parameters": [],
"html": "Revision with ID not found."
}
]
},
"module": "main"
}
],
"docref": "See http://localhost/wiki1/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."
}
```
Reading:**Expected behavior**:
The edit would be allowed, and is successful.
**AC**:
- We know where the problem stems from.
- A way forward to implement this functionality is defined
- A ticket (or tickets) have been created to tackle this topic
**Hints**:
- The issue identified in the ticket is with the `wbsetclaim` API, but this likely affects ALL APIs when used in this mode.
- Although the bug is likely in Wikibase or MediaWiki the MediaInfo extension will be greatly beneficial when debugging as it is the only entity type currently setup to work with MCR (Multi-Content Revision).
**Reading:**
- https://www.mediawiki.org/wiki/Requests_for_comment/Multi-Content_Revisions
- https://www.mediawiki.org/wiki/Extension:WikibaseMediaInfo
**Original Note:**
> In T263298 one of the issue at play is that you can't provide a baserevid to Wikibase API endpoints to create a mediainfo entity, if it didn't already exist.
This is discovered and confirmed in T263298#6494034
>
>> When a file on commons does not get have a media info entity attached to it, you can not use a baserevid in Wikibase API calls
>> This is a small issue with the MCR integration that someone will need to tackle for the edit conflict rules to be able to work in all cases.