CodeMirror forces loading of ext.wikiEditor module even when it isn't needed
Closed, ResolvedPublic5 Story Points

Description

There is code in CodeMirrorHooks::onResourceLoaderRegisterModules() that loads the ext.wikiEditor module from the WikiEditor extension if it is available. This module is only actually needed if the user has enabled the "enhanced editing toolbar" in their prefs (i.e. the "usebetatoolbar" user option). If they aren't using the enhanced toolbar, it shouldn't load the module, otherwise you get weird problems like a double border on the editing area.

Unfortunately, you can't successfully call $wgUser->getOption() from CodeMirrorHooks::onResourceLoaderRegisterModules(). You also can't call WikiEditorHooks::isEnabled( 'toolbar' ) since it uses $wgUser->getOption(). A more clever solution is needed.

kaldari created this task.Mar 27 2017, 1:54 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 27 2017, 1:54 AM
kaldari triaged this task as Normal priority.Apr 4 2017, 11:25 PM
kaldari set the point value for this task to 5.
kaldari moved this task from Sprint planning/estimation to Backlog on the Community-Tech board.

Hi @Pastakhov, could you shed some light on why WikiEditor is a dependency for CodeMirror? What does WikiEditor do specifically, that CodeMirror needs to run after it?

Hi @Niharika, I have not looked at it yet. Seems it is a bug. I'll try to resolve it...

Change 348677 had a related patch set uploaded (by Pastakhov):
[mediawiki/extensions/CodeMirror@master] Remove some outdated code

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

kaldari closed this task as Resolved.Apr 20 2017, 8:50 PM
kaldari moved this task from Ready to Done on the Community-Tech-Sprint board.

Change 348677 merged by jenkins-bot:
[mediawiki/extensions/CodeMirror@master] Remove some outdated code

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

DannyH moved this task from Backlog to Archive on the Community-Tech board.Apr 25 2017, 2:57 AM