Page MenuHomePhabricator

Multiple extensions: VisualEditor JavaScript should only be added if VisualEditor is installed
Closed, InvalidPublic

Description

wikihiero has the same problem as in T85007, though @Legoktm's comment on Patch Set 2 of https://gerrit.wikimedia.org/r/#/c/183906/ seems to suggest that the ResourceLoaderRegisterModules hook should be used instead of $wgExtensionFunctions for conditional registration of modules.

There was 1 error:

1) ResourcesTest::testUnsatisfiableDependencies
Undefined index: ext.visualEditor.mwcore

/home/ki/Projects/mediawiki/core/tests/phpunit/structure/ResourcesTest.php:94
/home/ki/Projects/mediawiki/core/tests/phpunit/MediaWikiTestCase.php:141

--

There were 2 failures:

[...]

2) ResourcesTest::testMissingDependencies
The module 'ext.visualEditor.mwcore' required by 'ext.wikihiero.visualEditor' must exist
Failed asserting that an array contains 'ext.visualEditor.mwcore'.

/home/ki/Projects/mediawiki/core/tests/phpunit/structure/ResourcesTest.php:74
/home/ki/Projects/mediawiki/core/tests/phpunit/MediaWikiTestCase.php:141

Related Objects

Event Timeline

PleaseStand raised the priority of this task from to Needs Triage.
PleaseStand updated the task description. (Show Details)
PleaseStand added a project: WikiHiero.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 31 2015, 11:00 PM

Apparently, Disambiguator, Math, and WikimediaEvents are also affected (in addition to wikihiero). This is already blocking merging of two changes:

PleaseStand renamed this task from wikihiero: VisualEditor JavaScript should only be added if VisualEditor is installed to Multiple extensions: VisualEditor JavaScript should only be added if VisualEditor is installed.Feb 1 2015, 1:47 AM
PleaseStand edited projects, added Tracking-Neverending, JavaScript; removed WikiHiero.
PleaseStand set Security to None.
gerritbot added a subscriber: gerritbot.

Change 187945 had a related patch set uploaded (by Florianschmidtwelzow):
Hygiene: Move magic mobile VE module registration out of extension function

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

Patch-For-Review

Change 187945 merged by jenkins-bot:
Hygiene: Move magic mobile VE module registration out of extension function

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

Aklapper triaged this task as High priority.Feb 2 2015, 6:24 PM

I'm not sure whether it makes sense to make the registration of these modules conditional. Except for the failing test, everything should be working fine as the module isn't added. I don't think it's unreasonable for unit tests to require additional dependencies even if the extension functions fine without them.

My comment was mainly that if you have to use conditional registration for whatever reason, you should use the ResourceLoaderRegisterModules hook instead of a $wgExtensionFunction.

Jdforrester-WMF lowered the priority of this task from High to Low.Aug 18 2015, 3:00 PM
Jdforrester-WMF added a subscriber: Jdforrester-WMF.
Deskana closed this task as Invalid.Apr 20 2018, 3:05 PM
Deskana added a subscriber: Deskana.

Tracking tasks are deprecated in Phabricator; see T192655.

Restricted Application removed a subscriber: Liuxinyu970226. · View Herald TranscriptApr 20 2018, 3:05 PM