Last modified: 2013-01-13 18:18:04 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 T39187, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 37187 - Don't remove custom user options when using Special:Preferences
Don't remove custom user options when using Special:Preferences
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
User preferences (Other open bugs)
1.21.x
All All
: Low enhancement with 1 vote (vote)
: ---
Assigned To: Bartosz Dziewoński
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-29 08:03 UTC by Michael M.
Modified: 2013-01-13 18:18 UTC (History)
7 users (show)

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


Attachments

Description Michael M. 2012-05-29 08:03:28 UTC
With [[mw:API:Options]] it is now possible for gadgets/user scripts/etc. to set their own custom options. But there is one drawback: Whenever the user changes his settings on Special:Preferences, those custom options are removed.
Steps to reproduce:

1. Visit [[Special:APISandbox]], get a token to change your options and then use action=options with change "gadget-foo-options-bar=baz".
2. Verify that the custom option is set by inspecting mw.user.options.
3. Visit [[Special:Preferences]] and click save.
4. Repeat step 2.

Desired result: The custom option is still present.
Actual result: The custom option doesn't exist any more.
Comment 1 db [inactive,noenotif] 2012-06-08 00:03:11 UTC
The Preferences reset first all to avoid storing all preferences in the database. Custom preferences are unknown to mediawiki and therefor removed.

Maybe custom preferences should by forbidden.
Comment 2 Liangent 2012-06-08 05:08:23 UTC
(In reply to comment #1)
> The Preferences reset first all to avoid storing all preferences in the
> database. Custom preferences are unknown to mediawiki and therefor removed.
> 
> Maybe custom preferences should by forbidden.

Can we just remove known preferences?
Comment 3 db [inactive,noenotif] 2012-06-08 09:27:47 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > The Preferences reset first all to avoid storing all preferences in the
> > database. Custom preferences are unknown to mediawiki and therefor removed.
> > 
> > Maybe custom preferences should by forbidden.
> Can we just remove known preferences?

Sorry, I mean old preferences, see the comment in Preferences.php:

"Keeps old preferences from interfering due to back-compat code, etc."

Custom preferences should be forbidden or there are allow with a fixed prefix, than it is possible to find that preferences and not removing it.
Comment 4 Rainer Rillke @commons.wikimedia 2012-09-10 10:20:32 UTC
As pointed out in Bug 40124, this would be a great help for community-scripts if properly implemented.
Comment 5 Bartosz Dziewoński 2013-01-13 18:18:04 UTC
Fixed by gerrit change I5f9ba5b0.

(See bug 40124 for details and discussion.)

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


Navigation
Links