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

pmiazga created this task.Feb 16 2017, 7:35 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 16 2017, 7:35 PM
Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptFeb 21 2017, 3:06 PM
ovasileva triaged this task as Low priority.Feb 21 2017, 3:09 PM
ovasileva moved this task from Incoming to Triaged but Future on the Readers-Web-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 closed this task as Resolved.May 3 2017, 3:40 PM
matthiasmullie claimed this task.
matthiasmullie reopened this task as Open.May 3 2017, 4:12 PM
matthiasmullie reassigned this task from matthiasmullie to Jdforrester-WMF.
matthiasmullie added a subscriber: matthiasmullie.

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

matthiasmullie closed this task as Resolved.May 4 2017, 10:43 AM