There is a problem when we are merging the previous config and the default config.

It uses \Drupal\Component\Utility\NestedArray::mergeDeepArray, which modifies the numeric keys:

       foreach ($array as $key => $value) {
        // Renumber integer keys as array_merge_recursive() does. Note that PHP
        // automatically converts array keys that are integer strings (e.g., '1')
        // to integers.
        if (is_integer($key)) {
          $result[] = $value;
         // Recurse when both values are arrays.
        elseif (isset($result[$key]) && is_array($result[$key]) && is_array($value)) {
        if (isset($result[$key]) && is_array($result[$key]) && is_array($value)) {
           $result[$key] = self::mergeDeepArray(array($result[$key], $value));

I'm not completely sure why this has not been showed by the tests before, but happened with #1798872: Convert admin_theme to CMI.

This is clearly against the requirement that numeric keys are allowed for CMI.


alexpott’s picture

Status: Active » Closed (duplicate)