Page MenuHomePhabricator

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

Description

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

brooke raised the priority of this task from to Needs Triage.
brooke updated the task description. (Show Details)
brooke subscribed.
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 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

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

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

Jdforrester-WMF subscribed.

Should now be fixed.