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

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.

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