Page MenuHomePhabricator

Exception encountered, of type "InvalidArgumentException" in update.php when 'vector' is symlinked to 'Vector'
Closed, ResolvedPublic

Description

In order to workaround T121490 I have symlinked "vector" in the "skins" directory to "Vector".

The CLI installer went fine, but running update.php fails with

Exception encountered, of type "InvalidArgumentException"

The stacktrace:

`
[5323b2ec] [no req]   InvalidArgumentException from line 88 of /usr/home/saper/public_html/collaps/includes/config/ConfigFactory.php: Invalid callback provided
Backtrace:
#0 /usr/home/saper/public_html/collaps/includes/config/ConfigFactory.php(59): ConfigFactory->register(string, array)
#1 /usr/home/saper/public_html/collaps/maintenance/doMaintenance.php(100): ConfigFactory::getDefaultInstance()
#2 /usr/home/saper/public_html/collaps/maintenance/update.php(214): require_once(string)
#3 {main}
`

What happens is that vector is added twice to $wgConfigRegistry:

`
array(2) {
  ["vector"]=>
  array(2) {
    [0]=>
    string(28) "GlobalVarConfig::newInstance"
    [1]=>
    string(28) "GlobalVarConfig::newInstance"
  }
  ["main"]=>
  string(28) "GlobalVarConfig::newInstance"
}
`

MediaWiki core: 5b0ebd7f3a6e1c215a6af56d966ee14047a9b44f

Event Timeline

saper raised the priority of this task from to Needs Triage.
saper updated the task description. (Show Details)
saper added a project: MediaWiki-Configuration.
saper subscribed.

Just noticed Vector got added twice to LocalSettings.php:

wfLoadSkin( 'vector' );
wfLoadSkin( 'Vector' );

So either we should not allow stashing multiple callbacks like this into the Config Registry, or maybe the updater should learn how to deal with an array there. Or just plainly fail in the right place.

Or...maybe you shouldn't try loading the same skin twice under different names?

@Legoktm sure, but let's have an error message instead.... I see that the current configurator is very versatile, but there is no easy place to put such a check in....

Line 297 of ExtensionProcessor::extractCredits() looks like a good place, before we store it in $this->credits. Do you want to write a patch for that or should I?

Reedy triaged this task as Low priority.Dec 18 2015, 1:44 PM

Change 261608 had a related patch set uploaded (by Legoktm):
registration: Prevent loading the same thing twice

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

Change 261608 merged by jenkins-bot:
registration: Prevent loading the same thing twice

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