Last modified: 2014-07-12 12:32:49 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T65391, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 63391 - Unexpected non-MediaWiki exception encountered, of type "InvalidArgumentException" in Special:SetSiteLink Exception from line 78 of ChangeOpSiteLink.php
Unexpected non-MediaWiki exception encountered, of type "InvalidArgumentExcep...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
master
All All
: High normal (vote)
: ---
Assigned To: Wikidata bugs
u=dev c=frontend p=0
:
Depends on:
Blocks: 40810
  Show dependency treegraph
 
Reported: 2014-04-01 20:38 UTC by Aude
Modified: 2014-07-12 12:32 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Aude 2014-04-01 20:38:43 UTC
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.

1) 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.

2) 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}
Comment 1 Aude 2014-04-01 20:39:47 UTC
see also bug: 63036
Comment 2 Aude 2014-05-02 05:18:17 UTC
When entering an invalid item id for a badge, I am now getting:

Unexpected non-MediaWiki exception encountered, of type "Wikibase\DataModel\Entity\EntityIdParsingException"
[f93cbde6] /wiki/Special:SetSiteLink Exception from line 64 of /Library/WebServer/Documents/php-master/extensions/Wikibase/vendor/wikibase/data-model/src/Entity/DispatchingEntityIdParser.php: The provided id serialization "gjklsgs" is not valid
Backtrace:
#0 /Library/WebServer/Documents/php-master/extensions/Wikibase/vendor/wikibase/data-model/src/Entity/DispatchingEntityIdParser.php(45): Wikibase\DataModel\Entity\DispatchingEntityIdParser->throwInvalidId(string)
#1 /Library/WebServer/Documents/php-master/extensions/Wikibase/repo/includes/specials/SpecialSetSiteLink.php(378): Wikibase\DataModel\Entity\DispatchingEntityIdParser->parse(string)
#2 /Library/WebServer/Documents/php-master/extensions/Wikibase/repo/includes/specials/SpecialSetSiteLink.php(451): Wikibase\Repo\Specials\SpecialSetSiteLink->parseBadges(array, Status)
#3 /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)
#4 /Library/WebServer/Documents/php-master/extensions/Wikibase/repo/includes/specials/SpecialModifyEntity.php(102): Wikibase\Repo\Specials\SpecialSetSiteLink->modifyEntity(Wikibase\DataModel\Entity\Item)
#5 /Library/WebServer/Documents/php-master/includes/specialpage/SpecialPage.php(379): Wikibase\Repo\Specials\SpecialModifyEntity->execute(NULL)
#6 /Library/WebServer/Documents/php-master/includes/specialpage/SpecialPageFactory.php(503): SpecialPage->run(NULL)
#7 /Library/WebServer/Documents/php-master/includes/Wiki.php(285): SpecialPageFactory::executePath(Title, RequestContext)
#8 /Library/WebServer/Documents/php-master/includes/Wiki.php(596): MediaWiki->performRequest()
#9 /Library/WebServer/Documents/php-master/includes/Wiki.php(448): MediaWiki->main()
#10 /Library/WebServer/Documents/php-master/index.php(46): MediaWiki->run()
#11 {main}
Comment 3 Gerrit Notification Bot 2014-05-02 05:59:59 UTC
Change 131023 had a related patch set uploaded by Aude:
Improve badge handling in SpecialSetSiteLink and fix uncaught exception

https://gerrit.wikimedia.org/r/131023
Comment 4 Gerrit Notification Bot 2014-06-04 16:53:35 UTC
Change 131023 abandoned by Aude:
Improve badge handling in SpecialSetSiteLink, using ExceptionLocalizer

Reason:
this needs to be split into multiple patches, and maybe put more of the badge handling with ChangeOpSiteLink

https://gerrit.wikimedia.org/r/131023
Comment 5 Marius Hoch 2014-07-12 12:32:49 UTC
Bug 61664 fixes this as a side effect AFAIS

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links