Page MenuHomePhabricator

Special:Preferences throws internal error on beta due to null defaults in Echo
Closed, ResolvedPublic

Description

image.png (842×1 px, 218 KB)

[Y9vMT27FaXH0uJ-7Wa9AOgAAAAA] /wiki/Special:Preferences MWException: Default 'null' is invalid for preference email-blacklist of user Jsn.sherman beta

Backtrace:

from /srv/mediawiki/php-master/includes/preferences/DefaultPreferencesFactory.php(354)
#0 /srv/mediawiki/php-master/includes/preferences/DefaultPreferencesFactory.php(263): MediaWiki\Preferences\DefaultPreferencesFactory->loadPreferenceValues(User, RequestContext, array)
#1 /srv/mediawiki/php-master/extensions/GlobalPreferences/includes/GlobalPreferencesFactory.php(115): MediaWiki\Preferences\DefaultPreferencesFactory->getFormDescriptor(User, RequestContext)
#2 /srv/mediawiki/php-master/includes/preferences/DefaultPreferencesFactory.php(1822): GlobalPreferences\GlobalPreferencesFactory->getFormDescriptor(User, RequestContext)
#3 /srv/mediawiki/php-master/includes/specials/SpecialPreferences.php(131): MediaWiki\Preferences\DefaultPreferencesFactory->getForm(User, RequestContext, string)
#4 /srv/mediawiki/php-master/includes/specials/SpecialPreferences.php(109): SpecialPreferences->getFormObject(User, RequestContext)
#5 /srv/mediawiki/php-master/includes/specialpage/SpecialPage.php(700): SpecialPreferences->execute(NULL)
#6 /srv/mediawiki/php-master/includes/specialpage/SpecialPageFactory.php(1458): SpecialPage->run(NULL)
#7 /srv/mediawiki/php-master/includes/MediaWiki.php(324): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, RequestContext)
#8 /srv/mediawiki/php-master/includes/MediaWiki.php(917): MediaWiki->performRequest()
#9 /srv/mediawiki/php-master/includes/MediaWiki.php(573): MediaWiki->main()
#10 /srv/mediawiki/php-master/index.php(50): MediaWiki->run()
#11 /srv/mediawiki/php-master/index.php(46): wfIndexMain()
#12 /srv/mediawiki/w/index.php(3): require(string)
#13 {main}

The change that surfaced this error was:
https://gerrit.wikimedia.org/r/c/mediawiki/core/+/824801

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 886066 had a related patch set uploaded (by Jsn.sherman; author: Jsn.sherman):

[mediawiki/extensions/Echo@master] GetPreferences: set default for mute lists

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

This comment was removed by jsn.sherman.
kostajh triaged this task as Unbreak Now! priority.Feb 2 2023, 5:00 PM
kostajh added subscribers: Umherirrender, matmarex.

Change 886087 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/core@master] Revert "htmlform: Improve validation of multiselect fields"

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

Change 886087 merged by jenkins-bot:

[mediawiki/core@master] Revert "htmlform: Improve validation of multiselect fields"

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

matmarex added a subscriber: kostajh.

Oops, thanks for catching this @jsn.sherman and @kostajh.

The patch wasn't included in a release yet, so no backports are needed.

Change 886066 abandoned by Jsn.sherman:

[mediawiki/extensions/Echo@master] GetPreferences: set default for mute lists

Reason:

identified a better fix

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

Change 886121 had a related patch set uploaded (by Jsn.sherman; author: Jsn.sherman):

[mediawiki/core@master] SpecialPreferences: make empty multiselect string

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

It looks like the issue was that preferences was defaulting mutiselects to null instead of empty strings, which does seem to be incorrect for this field type. I reverted the revert locally and changing it over to an empty string does seem to prevent the error and actually work.

Change 886121 abandoned by Jsn.sherman:

[mediawiki/core@master] SpecialPreferences: make empty multiselect string

Reason:

After looking at the html multiselect fields, I agree that the issue is the invalid defaults for those fields.

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