Last modified: 2014-08-24 02:30:20 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T29471, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 27471 - WikiEditor toolbar shows up unexpectedly
WikiEditor toolbar shows up unexpectedly
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikiEditor (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Trevor Parscal
:
Depends on:
Blocks: 27339 27368
  Show dependency treegraph
 
Reported: 2011-02-16 20:27 UTC by Roan Kattouw
Modified: 2014-08-24 02:30 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Roan Kattouw 2011-02-16 20:27:42 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)
Comment 1 Tim Starling 2011-02-17 02:40:07 UTC
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.
Comment 2 Roan Kattouw 2011-02-17 23:25:48 UTC
Thanks for debugging this, Tim. I tried to fix this in r82359 and deployed it.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links