Page MenuHomePhabricator

Special:Preferences: PHP Notice: Undefined index: 0
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error message
PHP Notice: Undefined index: 0
Impact

Notice thrown for a user on bewiktionary Special:Preferences.

Notes

Only found two occurrences, both on bewiktionary, probably the same user.

Details

Request URL
https://be.wiktionary.org/wiki/%D0%90%D0%B4%D0%BC%D1%8B%D1%81%D0%BB%D0%BE%D0%B2%D0%B0%D0%B5:Preferences
Stack Trace
#0 /srv/mediawiki/php-1.34.0-wmf.22/includes/htmlform/fields/HTMLMultiSelectField.php(205): MWExceptionHandler::handleError(integer, string, string, integer, array, array)
#1 /srv/mediawiki/php-1.34.0-wmf.22/includes/htmlform/HTMLFormField.php(582): HTMLMultiSelectField->getInputOOUI(array)
#2 /srv/mediawiki/php-1.34.0-wmf.22/includes/htmlform/HTMLForm.php(1701): HTMLFormField->getOOUI(array)
#3 /srv/mediawiki/php-1.34.0-wmf.22/includes/specials/forms/PreferencesFormOOUI.php(151): HTMLForm->displaySection(array, string, string)
#4 /srv/mediawiki/php-1.34.0-wmf.22/includes/htmlform/HTMLForm.php(1076): PreferencesFormOOUI->getBody()
#5 /srv/mediawiki/php-1.34.0-wmf.22/includes/htmlform/HTMLForm.php(1055): HTMLForm->getHTML(boolean)
#6 /srv/mediawiki/php-1.34.0-wmf.22/includes/htmlform/HTMLForm.php(606): HTMLForm->displayForm(boolean)
#7 /srv/mediawiki/php-1.34.0-wmf.22/includes/specials/SpecialPreferences.php(102): HTMLForm->show()
#8 /srv/mediawiki/php-1.34.0-wmf.22/includes/specialpage/SpecialPage.php(573): SpecialPreferences->execute(NULL)
#9 /srv/mediawiki/php-1.34.0-wmf.22/includes/specialpage/SpecialPageFactory.php(601): SpecialPage->run(NULL)
#10 /srv/mediawiki/php-1.34.0-wmf.22/includes/MediaWiki.php(296): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#11 /srv/mediawiki/php-1.34.0-wmf.22/includes/MediaWiki.php(892): MediaWiki->performRequest()
#12 /srv/mediawiki/php-1.34.0-wmf.22/includes/MediaWiki.php(523): MediaWiki->main()
#13 /srv/mediawiki/php-1.34.0-wmf.22/index.php(44): MediaWiki->run()
#14 /srv/mediawiki/w/index.php(3): include(string)
#15 {main}

Event Timeline

hashar created this task.Sep 11 2019, 1:59 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 11 2019, 1:59 PM
hashar updated the task description. (Show Details)Sep 11 2019, 2:01 PM

Only two occurrences, hardly a blocker.

Change 607868 had a related patch set uploaded (by Umherirrender; owner: Umherirrender):
[mediawiki/core@master] Do not access array index 0 directly, use reset

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

Line 208 is:

return $out[ 0 ];

So this looks like some code is defining a HTMLMultiSelectField with no options in it.

And on a closer look at https://be.wiktionary.org/wiki/Адмысловае:Preferences, this is indeed the case, and the culprit is Gadgets, as there are zero of them defined on that wiki.

Change 607868 merged by jenkins-bot:
[mediawiki/core@master] Avoid undefined index 0 in HTMLMultiSelectField class

https://gerrit.wikimedia.org/r/c/mediawiki/core/ /607868

matmarex closed this task as Resolved.Jun 29 2020, 3:26 PM
matmarex assigned this task to Umherirrender.