As of now, I consistently get a JavaScript failure when visiting https://en.wikipedia.org/wiki/Special:Preferences#mw-prefsection-rendering.
Exception in module-execute in module ext.GlobalPreferences.local:
Error: Unknown widget type: id: ooui-php-76, class: mw.widgets.UsersMultiselectWidget
at Object.OO.ui.Element.static.unsafeInfuse (load.php?lang=en&modules=ext.GlobalPreferences.local|jquery%2Coojs-ui-core%2Coojs-ui-widgets&skin=vector&version=z53ft:152)
at Object.OO.ui.Element.static.infuse (load.php?lang=en&modules=ext.GlobalPreferences.local|jquery%2Coojs-ui-core%2Coojs-ui-widgets&skin=vector&version=z53ft:151)
at Object.OO.ui.infuse (load.php?lang=en&modules=ext.GlobalPreferences.local|jquery%2Coojs-ui-core%2Coojs-ui-widgets&skin=vector&version=z53ft:148)
at updatePrefInput (load.php?lang=en&modules=ext.GlobalPreferences.local|jquery%2Coojs-ui-core%2Coojs-ui-widgets&skin=vector&version=z53ft:1)
at HTMLSpanElement.<anonymous> (load.php?lang=en&modules=ext.GlobalPreferences.local|jquery%2Coojs-ui-core%2Coojs-ui-widgets&skin=vector&version=z53ft:2)
at Function.each (load.php?lang=en&modules=ext.GlobalPreferences.local|jquery%2Coojs-ui-core%2Coojs-ui-widgets&skin=vector&version=z53ft:6)
at jQuery.fn.init.each (load.php?lang=en&modules=ext.GlobalPreferences.local|jquery%2Coojs-ui-core%2Coojs-ui-widgets&skin=vector&version=z53ft:4)
at load.php?lang=en&modules=ext.GlobalPreferences.local|jquery%2Coojs-ui-core%2Coojs-ui-widgets&skin=vector&version=z53ft:1
at load.php?lang=en&modules=ext.GlobalPreferences.local|jquery%2Coojs-ui-core%2Coojs-ui-widgets&skin=vector&version=z53ft:2
at runScript (load.php?lang=en&modules=startup&only=scripts&raw=1&safemode=1&skin=vector:12)The ooui-php-76 element this exception talks about is the email-blacklist preference from core: https://phabricator.wikimedia.org/source/mediawiki/browse/master/includes/preferences/DefaultPreferencesFactory.php$792. This is marked as 'type' => 'usersmultiselect', which translates to HTMLUsersMultiselectField in PHP and mw.widgets.UsersMultiselectWidget in JavaScript.
In the MediaWiki-extensions-GlobalPreferences extension.json we find:
"ext.GlobalPreferences.global": { … "dependencies": [ … "mediawiki.widgets.UsersMultiselectWidget" ], …
But the failure doesn't mention the ….global module. It's about the ….local module. This one doesn't list the widget as a dependency. Is this a mistake? Why is it even necessary in the first place that an extension lists dependencies for stuff that doesn't really have anything to do with the extension, but is entirely in core?
The best theory I have is that core intentionally skips loading the widget when the field is disabled, and GlobalPreferences needs to force loading it if it want's to enable the field. If this is true it would hint at a fragile design, in my opinion. A change in core will break the extension when it's not updated the same time. This is not sustainable, isn't it?
This issue continues what looks like a trend at this point:
- T296028 added mw.widgets.CheckMatrixWidget 3 weeks ago.
- T296638 added mw.widgets.TitlesMultiselectWidget 1 week ago.
- The patch https://gerrit.wikimedia.org/r/683142 (T272302) gets rid of the failing code, but isn't merged yet.