Page MenuHomePhabricator

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


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
#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) {
  array(2) {
    string(28) "GlobalVarConfig::newInstance"
    string(28) "GlobalVarConfig::newInstance"
  string(28) "GlobalVarConfig::newInstance"

MediaWiki core: 5b0ebd7f3a6e1c215a6af56d966ee14047a9b44f

Event Timeline

saper created this task.Dec 15 2015, 9:54 AM
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 added a subscriber: saper.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptDec 15 2015, 9:54 AM
saper added a comment.EditedDec 15 2015, 9:56 AM

Just noticed Vector got added twice to LocalSettings.php:

wfLoadSkin( 'vector' );
wfLoadSkin( 'Vector' );
saper added a comment.EditedDec 15 2015, 9:58 AM

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?

saper added a comment.Dec 15 2015, 9:40 PM

@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

Legoktm claimed this task.Dec 30 2015, 1:53 AM

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

Legoktm closed this task as Resolved.Dec 31 2015, 6:51 PM