Details
Related Objects
- Mentioned In
- T211473: JADE\Tests\Hooks\MoveHooksTest::testOnMovePageIsValidMove is broken
T211237: wbgetentities has stopped returning content on Beta Cluster Commons
rEWBIeff0468644e9: Follow-up 9210005: Move to the MediaWikiServices hook and scrap our class
rEWBI77890866ff27: Follow-up 9210005: Move to the MediaWikiServices hook and scrap our class
rEWBI56c26518317b: Follow-up 9210005: Move to the MediaWikiServices hook and scrap our class
rEWBI9210005e1699: Use SlotRoleHandler so that our content is editable again
rEWBIb75858efda4b: Use SlotRoleHandler so that our content is editable again
T211053: Error for file namespace should escape the title in the link - Mentioned Here
- T211800: Resolve ambiguity of entity ID prefixes used on Commons.
T211801: Find out how to deploy MediaInfo without breaking Commons
T211237: wbgetentities has stopped returning content on Beta Cluster Commons
rEWBI9210005e1699: Use SlotRoleHandler so that our content is editable again
rMWdb987c700adf: [MCR] Introduce SlotRoleHandler and SlotRoleRegistry
T210953: Wikidata is editable for blocked users
Event Timeline
This works fine on my local version with the latest wikibase. Some (other) quirk of beta perhaps?
Also if I try and edit captions on an existing image e.g. https://commons.wikimedia.beta.wmflabs.org/wiki/File:Martti_Jukola_reporting_from_a_sports_event,_1930s..jpg refreshing the captions fails
The reason is the api query for wbgetentities for the relevant mediainfo item returns "missing", see https://commons.wikimedia.beta.wmflabs.org/w/api.php?action=wbgetentities&format=json&props=info|labels&ids=M53736
Again works fine on my local version
Replicated locally as well as on Beta. Back-trace:
{ "error": { "code": "internal_api_error_MediaWiki\\Storage\\PageUpdateException", "info": "[a3dc984b44fa2b36b377efe2] Exception caught: Slot role `mediainfo` is not allowed.", "errorclass": "MediaWiki\\Storage\\PageUpdateException", "*": "MediaWiki\\Storage\\PageUpdateException at /vagrant/mediawiki/includes/Storage/PageUpdater.php(1260) #0 /vagrant/mediawiki/includes/Storage/PageUpdater.php(349): MediaWiki\\Storage\\PageUpdater->ensureRoleAllowed(string) #1 /vagrant/mediawiki/extensions/Wikibase/repo/includes/Store/Sql/WikiPageEntityStore.php(314): MediaWiki\\Storage\\PageUpdater->setContent(string, Wikibase\\MediaInfo\\Content\\MediaInfoContent) #2 /vagrant/mediawiki/extensions/Wikibase/repo/includes/Store/Sql/WikiPageEntityStore.php(207): Wikibase\\Repo\\Store\\WikiPageEntityStore->saveEntityContent(Wikibase\\MediaInfo\\Content\\MediaInfoContent, string, User, integer, boolean) #3 /vagrant/mediawiki/extensions/Wikibase/lib/includes/Store/TypeDispatchingEntityStore.php(87): Wikibase\\Repo\\Store\\WikiPageEntityStore->saveEntity(Wikibase\\MediaInfo\\DataModel\\MediaInfo, string, User, integer, boolean) #4 /vagrant/mediawiki/extensions/Wikibase/repo/includes/EditEntity/StatsdSaveTimeRecordingEntityStore.php(49): Wikibase\\Lib\\Store\\TypeDispatchingEntityStore->saveEntity(Wikibase\\MediaInfo\\DataModel\\MediaInfo, string, User, integer, boolean) #5 /vagrant/mediawiki/extensions/Wikibase/repo/includes/EditEntity/MediawikiEditEntity.php(709): Wikibase\\Repo\\EditEntity\\StatsdSaveTimeRecordingEntityStore->saveEntity(Wikibase\\MediaInfo\\DataModel\\MediaInfo, string, User, integer, boolean) #6 /vagrant/mediawiki/extensions/Wikibase/repo/includes/EditEntity/StatsdSaveTimeRecordingEditEntity.php(73): Wikibase\\Repo\\EditEntity\\MediawikiEditEntity->attemptSave(Wikibase\\MediaInfo\\DataModel\\MediaInfo, string, integer, string, boolean) #7 /vagrant/mediawiki/extensions/Wikibase/repo/includes/Api/EntitySavingHelper.php(350): Wikibase\\Repo\\EditEntity\\StatsdSaveTimeRecordingEditEntity->attemptSave(Wikibase\\MediaInfo\\DataModel\\MediaInfo, string, integer, string) #8 /vagrant/mediawiki/extensions/Wikibase/repo/includes/Api/ModifyEntity.php(309): Wikibase\\Repo\\Api\\EntitySavingHelper->attemptSaveEntity(Wikibase\\MediaInfo\\DataModel\\MediaInfo, string) #9 /vagrant/mediawiki/includes/api/ApiMain.php(1595): Wikibase\\Repo\\Api\\ModifyEntity->execute() #10 /vagrant/mediawiki/includes/api/ApiMain.php(531): ApiMain->executeAction() #11 /vagrant/mediawiki/includes/api/ApiMain.php(502): ApiMain->executeActionWithErrorHandling() #12 /vagrant/mediawiki/api.php(87): ApiMain->execute() #13 /var/www/w/api.php(5): require(string) #14 {main}" } }
Looks like this was broken by db987c700adfe8766316d56f2b4e05935e09d6a4 with the new SlotRoleHandler stuff?
"info": "[a3dc984b44fa2b36b377efe2] Exception caught: Slot role mediainfo is not allowed.",
That makes it sound like code somewhere needs to call MediaWikiServices::getSlotRoleRegistry()->defineRole( 'mediainfo', ... ) to define the mediainfo role. The "..." is a factory function for a SlotRoleHandler object, either a mediainfo-specific subclass or SlotRoleHandler itself if __construct() has enough flexibility do the right thing.
Change 477606 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/WikibaseMediaInfo@master] Use SlotRoleHandler so that our content is editable again
Change 477606 merged by jenkins-bot:
[mediawiki/extensions/WikibaseMediaInfo@master] Use SlotRoleHandler so that our content is editable again
Sorry about breaking this. I should have myself made the necessary patch.
I left a few comments on the patch about how to make this a bit smoother.
Change 477820 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/WikibaseMediaInfo@master] Follow-up 9210005: Move to the MediaWikiServices hook and scrap our class
Change 477820 merged by jenkins-bot:
[mediawiki/extensions/WikibaseMediaInfo@master] Follow-up 9210005: Move to the MediaWikiServices hook and scrap our class
So… my patch for this fixed it locally, but not on Beta Commons – content-not-allowed-here (e.g. "wikibase-mediainfo" content is not allowed on page File:Test-1445021196.521987.png in slot "Main") is still the error I get on trying to add a caption. Any ideas? Maybe related to T211237 brokeness?
The message is correct - wikibase-mediainfo is indeed not allowed in the Main slot. The question is, why is it trying to write mediainfo into the main slot?