I added a setting for badgeItems:
$wgWBRepoSettings['badgeItems'] = array( 'Q337', 'Q338' );
Then tried to use Special:SetSiteLink to add a badge, entering Q337 and encountered an uncaught exception.
- not sure I am setting badgeItems correctly. It is not documented in docs/options.wiki nor does Wikibase.default.php (in repo/config) explain the setting.
- I think a bit more handling of exceptions is needed in the special page to take care of edge cases and whatnot, like this.
Unexpected non-MediaWiki exception encountered, of type "InvalidArgumentException"
[c0399059] /wiki/Special:SetSiteLink Exception from line 78 of /Library/WebServer/Documents/php-master/extensions/Wikibase/repo/includes/ChangeOp/ChangeOpSiteLink.php: Only items specified in the config can be badges
Backtrace:
#0 /Library/WebServer/Documents/php-master/extensions/Wikibase/repo/includes/specials/SpecialSetSiteLink.php(458): Wikibase\ChangeOp\ChangeOpSiteLink->__construct(string, string, array)
#1 /Library/WebServer/Documents/php-master/extensions/Wikibase/repo/includes/specials/SpecialSetSiteLink.php(159): Wikibase\Repo\Specials\SpecialSetSiteLink->setSiteLink(Wikibase\DataModel\Entity\Item, string, string, array, Wikibase\Summary)
#2 /Library/WebServer/Documents/php-master/extensions/Wikibase/repo/includes/specials/SpecialModifyEntity.php(92): Wikibase\Repo\Specials\SpecialSetSiteLink->modifyEntity(Wikibase\DataModel\Entity\Item)
#3 /Library/WebServer/Documents/php-master/includes/specialpage/SpecialPage.php(379): Wikibase\Repo\Specials\SpecialModifyEntity->execute(NULL)
#4 /Library/WebServer/Documents/php-master/includes/specialpage/SpecialPageFactory.php(503): SpecialPage->run(NULL)
#5 /Library/WebServer/Documents/php-master/includes/Wiki.php(285): SpecialPageFactory::executePath(Title, RequestContext)
#6 /Library/WebServer/Documents/php-master/includes/Wiki.php(588): MediaWiki->performRequest()
#7 /Library/WebServer/Documents/php-master/includes/Wiki.php(447): MediaWiki->main()
#8 /Library/WebServer/Documents/php-master/index.php(46): MediaWiki->run()
#9 {main}
Version: master
Severity: normal
Whiteboard: u=dev c=frontend p=0