Page MenuHomePhabricator

Vagrant VE role localsettings conflicts with VisualEditor's user option defaults
Closed, ResolvedPublic


This line in the puppet-managed localsettings bit for VisualEditor's vagrant role:

$wgDefaultUserOptions['visualeditor-enable'] = 1;

seems to conflict with this default in VE's extension.json:

   "DefaultUserOptions": {
		"visualeditor-enable": 0,

resulting in a combined default of:

array( 1, 0 )

This breaks in User::getOptions:

( ! ) Notice: Array to string conversion in /vagrant/mediawiki/includes/User.php on line 2563

Event Timeline

brion raised the priority of this task from to Needs Triage.
brion updated the task description. (Show Details)
brion added a subscriber: brion.
Jdforrester-WMF triaged this task as Medium priority.
Jdforrester-WMF set Security to None.

This is because we do:

			} elseif ( is_array( $GLOBALS[$key] ) && is_array( $val ) ) {
				$GLOBALS[$key] = array_merge_recursive( $GLOBALS[$key], $val );

The easiest way to fix this is probably set the user option after VE has loaded (ew, load order). Long term we should look into creating a separate global for extension registration than configuration so we don't depend upon an explicit load order...

gerritbot added a subscriber: gerritbot.

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


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

Jdforrester-WMF added a subscriber: Jdforrester-WMF.

Should now be fixed.