Page MenuHomePhabricator

MultimediaViewer sets $wgDefaultUserOptions incorrectly; some users get the wrong default setting, others get their settings wiped every session
Closed, ResolvedPublic

Description

MultimediaViewer sets the $wgDefaultUserOptions['multimediaviewer-enable']via onExtensionFunction hook ( source MultimediaViewerHooks::onExtensionsFunction() ) This way is incorrect as it may lead to MediaWikiCore failures (see T153280: WANObjectCache breaks extending $wgDefaultUserOptions via ExtensionFunctions in extensions.).

Use the UserGetDefaultOptions hook instead.

Event Timeline

ovasileva moved this task from Incoming to Triaged but Future on the Web-Team-Backlog board.

Possibly this is related to a report at https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)#Media_Viewer_now_disabled_by_default.3F -

When I reset my preferences to default WP:Media Viewer is disabled. What's going on here? What's the skinny?

Notes:
I tried to reproduce this at Enwiki, with a test account....

"Reset preferences" did not initially disable MMV.

However, if I:

  • Manually Disable MMV, and Save prefs,
  • Manually Re-enable MMV and Save prefs,
  • Then Reset preferences to default,

Then MMV is turned off.

@Quiddity - yes, it's related. There is a race condition between setting up MultimediaViewer default state and reading stored user options from the cache.

Change 351526 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/MultimediaViewer@master] Move default user preference setting to appropriate hook

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

Jdforrester-WMF renamed this task from MultimediaViewer sets $wgDefaultUserOptions incorrectly to MultimediaViewer sets $wgDefaultUserOptions incorrectly; some users get the wrong default setting, others get their settings wiped every session.May 3 2017, 3:27 PM
Jdforrester-WMF moved this task from Backlog to In Process on the MediaViewer board.
Jdforrester-WMF added subscribers: Dvorapa, Framawiki, Tgr.
matthiasmullie reassigned this task from matthiasmullie to Jdforrester-WMF.
matthiasmullie subscribed.

Reopening - other issues are preventing this from being merged. Will fix those tomorrow.

Change 351526 merged by Matthias Mullie:
[mediawiki/extensions/MultimediaViewer@master] Move default user preference setting to appropriate hook

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