Page MenuHomePhabricator

MediaWiki extension registry fails when extension and skin have same name (eg: CustomPage)
Closed, DeclinedPublic

Description

The MediaWiki extension registration systems dies with a fatal error when trying to load the CustomPage extension and the CustomPage skin:

Fatal error: Uncaught exception 'Exception'
with message 'It was attempted to load CustomPage twice, skins/CustomPage/skin.json and extensions/CustomPage/extension.json.'
in includes/registration/ExtensionProcessor.php:360

Step to reproduce:

git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/CustomPage
git clone https://gerrit.wikimedia.org/r/mediawiki/skins/CustomPage

echo "wfLoadExtension( 'CustomPage' );" >> LocalSettings.php
echo "wfLoadSkin( 'CustomPage' );" >> LocalSettings.php

php maintenance/eval.php
<FATAL ERROR>

That is from ExtensionProcessor::extractCredits() and the duplicate detection has been made for T121493.

In theory one can reproduce by hitting recheck on a dummy change of the CustomPage extension : https://gerrit.wikimedia.org/r/#/c/324057/ however CI is unable to comment back on that task for an unknown reason :(

Event Timeline

hashar created this task.Dec 13 2016, 10:03 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 13 2016, 10:03 AM

Change 326916 had a related patch set uploaded (by Hashar):
[CustomPage] give reasons for non-voting jobs

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

Change 326916 merged by jenkins-bot:
[CustomPage] give reasons for non-voting jobs

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

The problem was introduced with a fix for T121493

So we need to either fix this so we can do both extensions and skins dir or rename the skins one to add skin prefix on the end.

Legoktm closed this task as Declined.Dec 13 2016, 2:09 PM

It is intentional that skins and extensions can't have the same name.

Fixed by @Umherirrender by renaming the skin with a 'Skin' suffix https://gerrit.wikimedia.org/r/#/c/381066/