Page MenuHomePhabricator

PHP Notice: Undefined index: data (via ProtectionForm.php in DropdownInputWidget.php)
Closed, ResolvedPublicPRODUCTION ERROR

Description

normalized_message
PHP Notice: Undefined index: data
exception.trace
from /srv/mediawiki/php-1.36.0-wmf.30/vendor/oojs/oojs-ui/php/widgets/DropdownInputWidget.php(86)
#0 /srv/mediawiki/php-1.36.0-wmf.30/vendor/oojs/oojs-ui/php/widgets/DropdownInputWidget.php(86): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.36.0-wmf.30/vendor/oojs/oojs-ui/php/widgets/DropdownInputWidget.php(33): OOUI\DropdownInputWidget->setOptions(array)
#2 /srv/mediawiki/php-1.36.0-wmf.30/includes/htmlform/fields/HTMLSelectField.php(81): OOUI\DropdownInputWidget->__construct(array)
#3 /srv/mediawiki/php-1.36.0-wmf.30/includes/htmlform/HTMLFormField.php(604): HTMLSelectField->getInputOOUI(string)
#4 /srv/mediawiki/php-1.36.0-wmf.30/includes/htmlform/HTMLForm.php(1730): HTMLFormField->getOOUI(string)
#5 /srv/mediawiki/php-1.36.0-wmf.30/includes/htmlform/HTMLForm.php(1322): HTMLForm->displaySection(array, string)
#6 /srv/mediawiki/php-1.36.0-wmf.30/includes/htmlform/OOUIHTMLForm.php(290): HTMLForm->getBody()
#7 /srv/mediawiki/php-1.36.0-wmf.30/includes/htmlform/HTMLForm.php(1103): OOUIHTMLForm->getBody()
#8 /srv/mediawiki/php-1.36.0-wmf.30/includes/ProtectionForm.php(604): HTMLForm->getHTML(boolean)
#9 /srv/mediawiki/php-1.36.0-wmf.30/includes/ProtectionForm.php(307): ProtectionForm->buildForm()
#10 /srv/mediawiki/php-1.36.0-wmf.30/includes/ProtectionForm.php(237): ProtectionForm->show()
#11 /srv/mediawiki/php-1.36.0-wmf.30/includes/page/Article.php(1846): ProtectionForm->execute()
#12 /srv/mediawiki/php-1.36.0-wmf.30/includes/actions/ProtectAction.php(47): Article->protect()
#13 /srv/mediawiki/php-1.36.0-wmf.30/includes/MediaWiki.php(532): ProtectAction->show()
#14 /srv/mediawiki/php-1.36.0-wmf.30/includes/MediaWiki.php(316): MediaWiki->performAction(Article, Title)
#15 /srv/mediawiki/php-1.36.0-wmf.30/includes/MediaWiki.php(944): MediaWiki->performRequest()
#16 /srv/mediawiki/php-1.36.0-wmf.30/includes/MediaWiki.php(548): MediaWiki->main()
#17 /srv/mediawiki/php-1.36.0-wmf.30/index.php(53): MediaWiki->run()
#18 /srv/mediawiki/php-1.36.0-wmf.30/index.php(46): wfIndexMain()
#19 /srv/mediawiki/w/index.php(3): require(string)
#20 {main}
Impact

Logspam.

Notes

Details

Request ID
YC5Br3k-uhxkmIVTsjj@7wAAABQ
Request URL
https://el.wikipedia.org/w/index.php?title=…&action=protect

Event Timeline

Krinkle renamed this task from PHP Notice: Undefined index: data to PHP Notice: Undefined index: data (via ProtectionForm.php in DropdownInputWidget.php).Feb 19 2021, 2:31 AM
Krinkle changed Request URL from https://el.wikipedia.org/w/index.php?title=%CE%88%CE%BB%CE%BB%CE%B7_%CE%9A%CE%BF%CE%BA%CE%BA%CE%AF%CE%BD%CE%BF%CF%85&action=protect to https://el.wikipedia.org/w/index.php?title=…&action=protect .
Krinkle moved this task from Untriaged to Feb 2021 on the Wikimedia-production-error board.
Krinkle updated the task description. (Show Details)

Change 665343 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/core@master] Don't accept empty option group names for dropdown elements

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

Change 665354 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[oojs/ui@master] Fix index error in DropdownInputWidget

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

There is a group with no label in this list: https://el.wikipedia.org/wiki/MediaWiki:Protect-dropdown?action=edit. This is accepted by ProtectionForm::buildForm() as well as Xml::listDropDownOptions() , but the OOUI DropdownInputWidget fails on empty labels.

I uploaded two fixes:

  • Fix the index error in OOUI.
  • Skip empty list entries in the code that parses wiki pages like the one above.

Change 665354 merged by jenkins-bot:
[oojs/ui@master] Fix index error in DropdownInputWidget

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

Change 665343 merged by jenkins-bot:
[mediawiki/core@master] Don't accept empty option group names for dropdown elements

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

matmarex assigned this task to thiemowmde.

Change 670240 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/core@master] Update OOUI to v0.41.2

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

Change 670240 merged by jenkins-bot:
[mediawiki/core@master] Update OOUI to v0.41.2

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