Page MenuHomePhabricator

Duplicate configuration values when using MediaWiki-Vagrant with new extension.json registration system
Closed, ResolvedPublic

Description

I am testing a patch that adds extension.json registration to Content Translation:

I am doing the testing on MediaWiki-Vagrant with a role/module I am writing for Content Translation (WIP):

For some reason, the settings applied through the ::mediawiki::extension puppet manifest and the settings that come from extension.json are both being applied instead of one being overwritten by the other. For example, if I add something like this to the MediaWiki-Vagrant module I am creating for Content Translation:

::mediawiki::extension { 'ContentTranslation':
    settings => {
      'wgContentTranslationSiteTemplates["view"]'   => '//$1.local.wmftest.net:8080/wiki/$2'
      'wgContentTranslationSiteTemplates["api"]'   => '$1.wikipedia.org/w/api.php'
      'wgContentTranslationSiteTemplates["cx"]'   => '//cxserver.wmflabs.org/v1'
    }
  }

But the extension.json file has the following:

	"config": {
		"ContentTranslationSiteTemplates": {
			"view": "//$1.wikipedia.org/wiki/$2",
			"api": "//$1.wikipedia.org/w/api.php",
			"cx": "http://localhost:8080"
		},
	}

What I end up with is urls that look like this:

http://cxserver.wikimedia.org/v1,http://localhost:8080/languagepairs

So it seems that both settings are being applied and the value is being turned into an array.

I'm not sure if this is a bug or I'm just missing something on how things should be set up. Any information would be most helpful.

Event Timeline

Jsahleen raised the priority of this task from to Needs Triage.
Jsahleen updated the task description. (Show Details)
Jsahleen added subscribers: Jsahleen, Legoktm.
Legoktm set Security to None.

I think this is the same issue as T88665, just showing up in a different way.

@Legoktm

I tried setting the local user options separately using ::mediawiki::settings and put the priority at 90 so it would be loaded after the ContentTranslation extension is loaded as suggested in T88665. Does not seem to have had any effect.

Any other ideas?

gerritbot subscribed.

Change 190419 had a related patch set uploaded (by Legoktm):
registration: Improve merging of arrays

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

Patch-For-Review

@Legoktm

I tried setting the local user options separately using ::mediawiki::settings and put the priority at 90 so it would be loaded after the ContentTranslation extension is loaded as suggested in T88665. Does not seem to have had any effect.

Actually even that would be too early. The extension is only loaded at the top of Setup.php when ExtensionRegistry::getInstance()->loadFromQueue() is run. Requiring an explicit load order is something we want to move away from, so I've uploaded a patch which should (hopefully) fix the merging issue.

Change 190419 merged by jenkins-bot:
registration: Improve merging of arrays

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

Jdforrester-WMF subscribed.

Should now be fixed.