Page MenuHomePhabricator

Call to undefined method Wikibase\Client\Hooks\OtherProjectsSidebarGenerator::buildProjectLinkSidebarFromItemId()
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

MediaWiki version: 1.35.0-wmf.41

message
Call to undefined method Wikibase\Client\Hooks\OtherProjectsSidebarGenerator::buildProjectLinkSidebarFromItemId()

Impact

37 events in the past hour. ArticlePlaceholder not available.

Notes

Remaining AC:

  • see if the restored method that is now unused can/should be moved to ArticlePlaceholder
  • create an phpunit integration test that covers the special page actually rendering an item

Details

Request ID
6c35d025-2d41-482a-b8ba-275e056cd5fc
Request URL
https://nn.wikipedia.org/wiki/Spesial:AboutTopic/Q17391659
Stack Trace
exception.trace
#0 /srv/mediawiki/php-1.35.0-wmf.41/extensions/ArticlePlaceholder/includes/AboutTopicRenderer.php(128): ArticlePlaceholder\AboutTopicRenderer->setOtherProjectsLinks(Wikibase\DataModel\Entity\ItemId, OutputPage)
#1 /srv/mediawiki/php-1.35.0-wmf.41/extensions/ArticlePlaceholder/includes/Specials/SpecialAboutTopic.php(173): ArticlePlaceholder\AboutTopicRenderer->showPlaceholder(Wikibase\DataModel\Entity\ItemId, Language, User, OutputPage)
#2 /srv/mediawiki/php-1.35.0-wmf.41/extensions/ArticlePlaceholder/includes/Specials/SpecialAboutTopic.php(131): ArticlePlaceholder\Specials\SpecialAboutTopic->showContent(string)
#3 /srv/mediawiki/php-1.35.0-wmf.41/includes/specialpage/SpecialPage.php(600): ArticlePlaceholder\Specials\SpecialAboutTopic->execute(string)
#4 /srv/mediawiki/php-1.35.0-wmf.41/includes/specialpage/SpecialPageFactory.php(635): SpecialPage->run(string)
#5 /srv/mediawiki/php-1.35.0-wmf.41/includes/MediaWiki.php(307): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#6 /srv/mediawiki/php-1.35.0-wmf.41/includes/MediaWiki.php(940): MediaWiki->performRequest()
#7 /srv/mediawiki/php-1.35.0-wmf.41/includes/MediaWiki.php(543): MediaWiki->main()
#8 /srv/mediawiki/php-1.35.0-wmf.41/index.php(53): MediaWiki->run()
#9 /srv/mediawiki/php-1.35.0-wmf.41/index.php(46): wfIndexMain()
#10 /srv/mediawiki/w/index.php(3): require(string)
#11 {main}

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 16 2020, 3:00 PM

OtherProjectsSidebarGenerator::buildProjectLinkSidebarFromItemId() was removed by @Tpt in I2175ba536d – “This hook is not used anymore”. It seems that’s not quite true.

Apparently the hook is supposed to be replaced by WikibaseClientSiteLinksForItem in other extensions, and WikimediaBadges was updated, but ArticlePlaceholder wasn’t. I think for wmf.41 we can just revert that commit, and then worry about updating ArticlePlaceholder later (I’m not sure how much work it would be).

Change 613168 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@master] Revert "Removes OtherProjectsSidebar hook"

https://gerrit.wikimedia.org/r/613168

Change 613170 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@wmf/1.35.0-wmf.41] Revert "Removes OtherProjectsSidebar hook"

https://gerrit.wikimedia.org/r/613170

Change 613188 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/extensions/Wikibase@master] Readd OtherProjectsSidebarGenerator::buildProjectLinkSidebarFromItemId

https://gerrit.wikimedia.org/r/613188

Change 613170 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@wmf/1.35.0-wmf.41] Revert "Removes OtherProjectsSidebar hook"

https://gerrit.wikimedia.org/r/613170

Mentioned in SAL (#wikimedia-operations) [2020-07-16T15:51:10Z] <lucaswerkmeister-wmde@deploy1001> Synchronized php-1.35.0-wmf.41/extensions/Wikibase/: Backport: [[gerrit:613170|Revert "Revert "Removes OtherProjectsSidebar hook"" (T258184)]] (duration: 01m 02s)

Change 613194 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@wmf/1.35.0-wmf.41] Revert "Revert "Removes OtherProjectsSidebar hook""

https://gerrit.wikimedia.org/r/613194

Change 613194 merged by Lucas Werkmeister (WMDE):
[mediawiki/extensions/Wikibase@wmf/1.35.0-wmf.41] Revert "Revert "Removes OtherProjectsSidebar hook""

https://gerrit.wikimedia.org/r/613194

Change 613170 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@wmf/1.35.0-wmf.41] Revert "Removes OtherProjectsSidebar hook"

https://gerrit.wikimedia.org/r/613170

Okay, so this one didn’t work, lots of logstash errors:

TypeError from line 52 of /srv/mediawiki/php-1.35.0-wmf.41/extensions/Wikibase/client/includes/Hooks/OtherProjectsSidebarGenerator.php: Argument 2 passed to Wikibase\Client\Hooks\OtherProjectsSidebarGenerator::__construct() must be an instance of Wikibase\Client\Hooks\SiteLinksForDisplayLookup, instance of Wikibase\Lib\Store\CachingSiteLinkLookup given

Let’s try this one instead:

Change 613188 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/extensions/Wikibase@master] Readd OtherProjectsSidebarGenerator::buildProjectLinkSidebarFromItemId

https://gerrit.wikimedia.org/r/613188

Change 613173 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Addshore):
[mediawiki/extensions/Wikibase@wmf/1.35.0-wmf.41] Re add OtherProjectsSidebarGenerator::buildProjectLinkSidebarFromItemId

https://gerrit.wikimedia.org/r/613173

Change 613188 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Re add OtherProjectsSidebarGenerator::buildProjectLinkSidebarFromItemId

https://gerrit.wikimedia.org/r/613188

Change 613173 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@wmf/1.35.0-wmf.41] Re add OtherProjectsSidebarGenerator::buildProjectLinkSidebarFromItemId

https://gerrit.wikimedia.org/r/613173

Mentioned in SAL (#wikimedia-operations) [2020-07-16T16:45:06Z] <lucaswerkmeister-wmde@deploy1001> Synchronized php-1.35.0-wmf.41/extensions/Wikibase/: Backport: [[gerrit:613173|Re add OtherProjectsSidebarGenerator::buildProjectLinkSidebarFromItemId (T258184)]] (duration: 01m 02s)

Alright, that seems to have resolved the production error.

Leaving the task open in case ArticlePlaceholder should be ported to something else (I might look more into it tomorrow).

Tpt added a comment.Jul 16 2020, 6:24 PM

@Lucas_Werkmeister_WMDE @Addshore Thank you very much for having handled this error and sorry for having introduced it. You are amazing!

Change 613168 abandoned by Addshore:
[mediawiki/extensions/Wikibase@master] Revert "Removes OtherProjectsSidebar hook"

Reason:
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/ /613188 is merged on master now

https://gerrit.wikimedia.org/r/613168

Addshore closed this task as Resolved.Jul 16 2020, 7:08 PM

@Lucas_Werkmeister_WMDE @Addshore Thank you very much for having handled this error and sorry for having introduced it. You are amazing!

My bad for not spotting it in CR! :)

Addshore reopened this task as Open.Jul 16 2020, 7:09 PM

Leaving the task open in case ArticlePlaceholder should be ported to something else (I might look more into it tomorrow).

Just saw this so reopening.
Might be nice to file another task to track that though.
And potentially introducing 1 new integration style test for the special page which would have caught this

Addshore moved this task from Incoming to Done on the ArticlePlaceholder board.Jul 16 2020, 7:10 PM
This comment was removed by Michael.
Michael updated the task description. (Show Details)Jul 21 2020, 1:15 PM
Michael updated the task description. (Show Details)Aug 4 2020, 9:46 AM

Change 618337 had a related patch set uploaded (by Tobias Andersson; owner: Tobias Andersson):
[mediawiki/extensions/ArticlePlaceholder@master] WIP: Add integration test for buildProjectLinkSidebarFromItemId

https://gerrit.wikimedia.org/r/618337

Change 618516 had a related patch set uploaded (by Michael Große; owner: Michael Große):
[mediawiki/extensions/Wikibase@master] Add test for buildProjectLinkSidebarFromItemId

https://gerrit.wikimedia.org/r/618516

Change 618337 merged by jenkins-bot:
[mediawiki/extensions/ArticlePlaceholder@master] Add integration test for buildProjectLinkSidebarFromItemId

https://gerrit.wikimedia.org/r/618337

Change 618516 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Add test for buildProjectLinkSidebarFromItemId

https://gerrit.wikimedia.org/r/618516

As far as I can tell, all associated patches have been either merged or abandoned.

Lucas_Werkmeister_WMDE closed this task as Resolved.Aug 19 2020, 2:44 PM

I think we can close this. The method is restored, its test is back, and we have an integration test in ArticlePlaceholder.

  • see if the restored method that is now unused can/should be moved to ArticlePlaceholder

Not trivially – it uses two private methods of OtherProjectsSidebarGenerator.