Page MenuHomePhabricator

PHP Notice: Undefined index: href (from ContentTranslationSpecialPage.php)
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

MediaWiki version: 1.36.0-wmf.11

message
PHP Notice: Undefined index: href
exception.trace
#0 /srv/mediawiki/php-1.36.0-wmf.11/extensions/ContentTranslation/specials/ContentTranslationSpecialPage.php(180): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.36.0-wmf.11/extensions/ContentTranslation/specials/ContentTranslationSpecialPage.php(97): ContentTranslationSpecialPage->getPersonalMenuList(array)
#2 /srv/mediawiki/php-1.36.0-wmf.11/extensions/ContentTranslation/specials/ContentTranslationSpecialPage.php(45): ContentTranslationSpecialPage->createHeaderHtml()
#3 /srv/mediawiki/php-1.36.0-wmf.11/includes/specialpage/SpecialPage.php(600): ContentTranslationSpecialPage->execute(NULL)
#4 /srv/mediawiki/php-1.36.0-wmf.11/includes/specialpage/SpecialPageFactory.php(709): SpecialPage->run(NULL)
#5 /srv/mediawiki/php-1.36.0-wmf.11/includes/MediaWiki.php(307): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#6 /srv/mediawiki/php-1.36.0-wmf.11/includes/MediaWiki.php(940): MediaWiki->performRequest()
#7 /srv/mediawiki/php-1.36.0-wmf.11/includes/MediaWiki.php(543): MediaWiki->main()
#8 /srv/mediawiki/php-1.36.0-wmf.11/index.php(53): MediaWiki->run()
#9 /srv/mediawiki/php-1.36.0-wmf.11/index.php(46): wfIndexMain()
#10 /srv/mediawiki/w/index.php(3): require(string)
#11 {main}

Impact

Tha issue can be experienced by accessing the Translation stats page while logged-out and clicking in "Not logged in" option from the personal toolbar menu. A a result, the user is redirected to the Null article.
Happening somewhat regularly on multiple Wikipedia wikis

Notes

Details

Request ID
b96569a3-f65f-4819-b37e-e57d7c3f6dc8
Request URL
https://zu.wikipedia.org/wiki/Special:ContentTranslationStats

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 14 2020, 6:35 PM
Krinkle renamed this task from PHP Notice: Undefined index: href to PHP Notice: Undefined index: href (from ContentTranslationSpecialPage.php).Oct 14 2020, 7:00 PM
Krinkle triaged this task as High priority.
Krinkle updated the task description. (Show Details)
Krinkle edited Stack Trace. (Show Details)
git shortlog origin/wmf/1.36.0-wmf.10..origin/wmf/1.36.0-wmf.11 
NikG (9):
      SXContentComparator: Fix UI color glitch in open tab icon
      UI lib MwButton: Add progressive and destructive colors for text buttons
      SXEditor: Add original sentence panel
      SXSentenceSelector: Create content header SFC and fix UI glitches
      SXSentenceSelector: Fix edit translation button color
      SXEditor: Set edited translation state variable on edit completed
      SX mobile layout: Fix height for fullscreen to not crop content
      SXSentenceSelector: Fix indent for sentences following selected sentence
      SXSentenceSelector: Fix regression for selected sentence bounce

Santhosh Thottingal (1):
      CX3 Build 0.1.0+20200925 with dependency updates

Translation updater bot (5):
      Localisation updates from https://translatewiki.net.
      Localisation updates from https://translatewiki.net.
      Localisation updates from https://translatewiki.net.
      Localisation updates from https://translatewiki.net.
      Localisation updates from https://translatewiki.net.

libraryupgrader (1):
      build: Updating mediawiki/mediawiki-phan-config to 0.10.3

With high confidence this is not caused by a change in CX.

The contract of SkinTemplate::getStructuredPersonalTools is not clear, but I think someone has started adding a personal tool item without a link.

After some searching, the cause is rMWb536db40e35c: Provide basic anon personal menu placeholder.

For some reason I cannot produce this locally:

mw.config.values.personalMenuList
0: {text: "(pt-login)", href: "/w/index.php?title=Special:UserLogin&returnto=Spec…ntentTranslationStats&returntoquery=uselang%3Dqqx", title: "(tooltip-pt-login)(word-separator)(brackets: (accesskey-pt-login))", accesskey: "(accesskey-pt-login)"}
length: 1

Whereas in production I get:

mw.config.values.personalMenuList
0: {text: "(notloggedin)", href: null, title: "(tooltip-pt-anonuserpage)(word-separator)(brackets: (accesskey-pt-anonuserpage))", accesskey: "(accesskey-pt-anonuserpage)"}
1: {text: "(pt-createaccount)", href: "/w/index.php?title=Especial:Crea_compte&returnto=E…ts&returntoquery=uselang%3Dqqx%26useskin%3Dvector", title: "(tooltip-pt-createaccount)(word-separator)(brackets: (accesskey-pt-createaccount))", accesskey: "(accesskey-pt-createaccount)"}
2: {text: "(pt-login)", href: "/w/index.php?title=Especial:Registre_i_entrada&ret…ts&returntoquery=uselang%3Dqqx%26useskin%3Dvector", title: "(tooltip-pt-login)(word-separator)(brackets: (accesskey-pt-login))", accesskey: "(accesskey-pt-login)"}
3: {text: "(anontalk)", href: "/wiki/Especial:Discussi%C3%B3_personal", title: "(tooltip-pt-anontalk)(word-separator)(brackets: (accesskey-pt-anontalk))", accesskey: "(accesskey-pt-anontalk)"}
4: {text: "(anoncontribs)", href: "/wiki/Especial:Contribucions_pr%C3%B2pies", title: "(tooltip-pt-anoncontribs)(word-separator)(brackets: (accesskey-pt-anoncontribs))", accesskey: "(accesskey-pt-anoncontribs)"}

Perhaps this is due to not allowing account creations on my development wiki.

Even if the backend is changed to handle missing href, frontend does not handle it and produces links to the "null" page.

Ammarpad added a subscriber: Ammarpad.EditedOct 15 2020, 11:45 AM

For some reason I cannot produce this locally:
Perhaps this is due to not allowing account creations on my development wiki.

Yes, the placeholder is set only for non logged-in users

Even if the backend is changed to handle missing href, frontend does not handle it and produces links to the "null" page.

CX needs to unset the link. I have already wrote patch for that.

Change 634210 had a related patch set uploaded (by Ammarpad; owner: Ammarpad):
[mediawiki/extensions/ContentTranslation@master] Unset anon userpage placeholder

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

Pginer-WMF updated the task description. (Show Details)Oct 16 2020, 8:59 AM

This seems to be happening somewhat in this week's train. About 18 instance in the last four hours on group0.

Change 634210 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Unset anon userpage placeholder

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

It's very harmless apart from logspam. If it is too much the fix can be backported.

Nikerabbit closed this task as Resolved.Mon, Nov 16, 8:49 AM
Nikerabbit claimed this task.
Nikerabbit moved this task from Needs Triage to Bugs on the ContentTranslation board.