Commit e40f6d17 authored by catch's avatar catch
Browse files

Issue #2852557 by bircher, alexpott, longwave, nedjo, dww: Config export key...

Issue #2852557 by bircher, alexpott, longwave, nedjo, dww: Config export key order is not predictable, use config schema to order keys for maps
parent 190aae10
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -108,11 +108,11 @@ _core_config_info:
config_object:
  type: mapping
  mapping:
    _core:
      type: _core_config_info
    langcode:
      type: string
      label: 'Language code'
    _core:
      type: _core_config_info

# Mail text with subject and body parts.
mail:
@@ -303,6 +303,9 @@ block_settings:
    label_display:
      type: string
      label: 'Display title'
    provider:
      type: string
      label: 'Provider'
    status:
      type: boolean
      label: 'Status'
@@ -312,9 +315,6 @@ block_settings:
    view_mode:
      type: string
      label: 'View mode'
    provider:
      type: string
      label: 'Provider'
    context_mapping:
      type: sequence
      label: 'Context assignments'
+1 −1
Original line number Diff line number Diff line
@@ -87,8 +87,8 @@ protected function baseConfigurationDefaults() {
    return [
      'id' => $this->getPluginId(),
      'label' => '',
      'provider' => $this->pluginDefinition['provider'],
      'label_display' => BlockPluginInterface::BLOCK_LABEL_VISIBLE,
      'provider' => $this->pluginDefinition['provider'],
    ];
  }

+2 −0
Original line number Diff line number Diff line
@@ -42,6 +42,8 @@ public function getConfiguration() {
      // configured, so remove the context_mapping from the instance config to
      // compare the remaining values.
      unset($instance_config['context_mapping']);
      ksort($default_config);
      ksort($instance_config);
      if ($default_config === $instance_config) {
        unset($configuration[$instance_id]);
      }
+1 −3
Original line number Diff line number Diff line
@@ -208,9 +208,7 @@ public function save($has_trusted_data = FALSE) {
      if ($this->typedConfigManager->hasConfigSchema($this->name)) {
        // Ensure that the schema wrapper has the latest data.
        $this->schemaWrapper = NULL;
        foreach ($this->data as $key => $value) {
          $this->data[$key] = $this->castValue($key, $value);
        }
        $this->data = $this->castValue(NULL, $this->data);
      }
      else {
        foreach ($this->data as $key => $value) {
+6 −2
Original line number Diff line number Diff line
@@ -351,13 +351,17 @@ protected function createConfiguration($collection, array $config_to_create) {
        $new_config = new Config($name, $this->getActiveStorages($collection), $this->eventDispatcher, $this->typedConfig);
      }
      if ($config_to_create[$name] !== FALSE) {
        $new_config->setData($config_to_create[$name]);
        // Add a hash to configuration created through the installer so it is
        // possible to know if the configuration was created by installing an
        // extension and to track which version of the default config was used.
        if (!$this->isSyncing() && $collection == StorageInterface::DEFAULT_COLLECTION) {
          $new_config->set('_core.default_config_hash', Crypt::hashBase64(serialize($config_to_create[$name])));
          $config_to_create[$name] = [
            '_core' => [
              'default_config_hash' => Crypt::hashBase64(serialize($config_to_create[$name])),
            ],
          ] + $config_to_create[$name];
        }
        $new_config->setData($config_to_create[$name]);
      }
      if ($collection == StorageInterface::DEFAULT_COLLECTION && $entity_type = $this->configManager->getEntityTypeIdByName($name)) {
        // If we are syncing do not create configuration entities. Pluggable
Loading