Page MenuHomePhabricator

Loading oojs-ui-core without oojs-ui-toolbars causes JS error
Closed, ResolvedPublic

Description

@SBisson reports that https://en.wikipedia.beta.wmflabs.org/wiki/Special:Notifications throws the following JS error:

load.php?debug=false&lang=en&modules=oojs-ui-core%2Coojs-ui-widgets&skin=vector&version=0jy36b4:141 Uncaught TypeError: Right-hand side of 'instanceof' is not an object
    at OoUiMediaWikiTheme.OO.ui.MediaWikiTheme.getElementClasses (load.php?debug=false&lang=en&modules=oojs-ui-core%2Coojs-ui-widgets&skin=vector&version=0jy36b4:141)
    at OoUiMediaWikiTheme.OO.ui.Theme.updateElementClasses (load.php?debug=false&lang=en&modules=oojs-ui-core%2Coojs-ui-widgets&skin=vector&version=0jy36b4:20)
    at OoUiMediaWikiTheme.OO.ui.Theme.updateQueuedElementClasses (load.php?debug=false&lang=en&modules=oojs-ui-core%2Coojs-ui-widgets&skin=vector&version=0jy36b4:20)
    at later (load.php?debug=false&lang=en&modules=oojs-ui-core%2Coojs-ui-widgets&skin=vector&version=0jy36b4:3)

This is because OO.ui.MediaWikiTheme.prototype.getElementClasses checks element instanceof OO.ui.ToolGroup, but OO.ui.ToolGroup does not exist because we do not load the toolbars module on that page.

git blame blames rGOJUd22d23311b83: PopupToolGroup: Mixin flaggable

Event Timeline

Catrope created this task.Apr 19 2017, 5:33 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 19 2017, 5:33 PM
Catrope triaged this task as Unbreak Now! priority.Apr 19 2017, 5:34 PM
Catrope updated the task description. (Show Details)
Catrope added a project: Regression.
Catrope added a subscriber: SBisson.
Restricted Application added subscribers: Jay8g, TerraCodes. · View Herald TranscriptApr 19 2017, 5:35 PM

Change 348977 had a related patch set uploaded (by Jforrester):
[oojs/ui@master] Follow-up d22d23311: Don't reference OO.ui.ToolGroup blindly

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

Change 348978 had a related patch set uploaded (by Jforrester):
[mediawiki/core@master] HACK: Temporarily patch OOjs UI locally to work around upstream problem

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

Jdforrester-WMF closed this task as Resolved.Apr 19 2017, 6:29 PM
Jdforrester-WMF claimed this task.
Jdforrester-WMF moved this task from Backlog to OOjs-UI-0.21.2 on the OOUI board.
Jdforrester-WMF edited projects, added OOUI (OOjs-UI-0.21.2); removed OOUI.
Jdforrester-WMF removed a project: Patch-For-Review.

Change 348978 merged by jenkins-bot:
[mediawiki/core@master] HACK: Temporarily patch OOjs UI locally to work around upstream problem

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

Change 348977 merged by jenkins-bot:
[oojs/ui@master] Follow-up d22d23311: Don't reference OO.ui.ToolGroup blindly

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