Last modified: 2014-08-24 02:30:20 UTC
MW seems to be writing rows with up_value='' to the DB for certain toggle prefs. Empty values for these prefs are interpreted very strangely, where certain prefs (notably usebetatoolbar, probably because the default is 1) are considered to be set to 1 for the purposes of deciding to use the feature (i.e. User::getOption()) but 0 for the purposes of the preference form. This means the relevant feature is enabled but can't be disabled in Special:Preferences. I discovered these values before the Feb 16 deployment, and wrote a script to fix them. But they're now back in larger numbers, so it must be 1.17, not 1.16, corrupting the DB here. Sample from dewiki: mysql> SELECT up_property, COUNT(DISTINCT up_user) FROM user_properties WHERE up_value = '' GROUP BY up_property; +-----------------------+-------------------------+ | up_property | COUNT(DISTINCT up_user) | +-----------------------+-------------------------+ | ajaxsearch | 21902 | | contextchars | 32 | | contextlines | 32 | | date | 22457 | | editsection | 299 | | enotifusertalkpages | 1023 | | flaggedrevseditdiffs | 48 | | flaggedrevsstable | 4 | | forceeditsummary | 130 | | highlightbroken | 179 | | imagesize | 5 | | language | 4 | | math | 34 | | nickname | 159014 | | previewontop | 691 | | quickbar | 43 | | rclimit | 53 | | searchNs0 | 277 | | searchlimit | 34 | | showjumplinks | 506 | | showtoc | 188 | | showtoolbar | 382 | | skin | 430086 | | timecorrection | 108414 | | usebetatoolbar | 72 | | usebetatoolbar-cgd | 1332 | | useeditwarning | 306 | | variant | 134463 | | vector-collapsiblenav | 176 | | vector-simplesearch | 20 | | watchcreations | 9732 | | watchlistdays | 5 | | watchlisttoken | 25067 | | wllimit | 4377 | +-----------------------+-------------------------+ 34 rows in set (18.73 sec)
My testing indicates that even in 1.16, an empty string was used for false for toggles where the default is true. User::getBoolOption() will return an appropriately typed value, but all it does is (bool)$value. SpecialPrefSwitch::isSwitchedOn() and WikiEditorHooks::isEnabled() both make use of PHP's double-equals operator to perform implicit conversion from string to integer or boolean, and surprisingly, this appears to work correctly. Perhaps the issue is actually the usebetatoolbar-cgd option. WikiEditor is disabled by omitting its module from the output. When usebetatoolbar-cgd is enabled, the ext.wikiEditor.dialogs is added to $wgOut, which depends on ext.wikiEditor.toolbar. So both are loaded and the toolbar is automatically shown. When I tested it on Wikipedia, the old toolbar was shown only when both preferences were disabled.
Thanks for debugging this, Tim. I tried to fix this in r82359 and deployed it.