Default config hash is not generated for imported configuration

Created on 22 May 2019, over 5 years ago
Updated 21 August 2024, 4 months ago

When importing new configuration from module, it will be missing _core.default_config_hash, which leads to situation that configuration will never get translations from localize servers, as it counts as customized.

To easily see what this is all about, let's create dummy module,
modules/custom/mah_module/mah_module.info.yml

type: module
name: mah_module
core: 8.x

Now let's enable that module via drush en -y mah_module

then create some configuration, like this
modules/custom/mah_module/config/install/system.action.mah_module_unpublish_action.yml

langcode: en
status: true
dependencies:
  module:
    - node
id: mah_module_unpublish_action
label: 'Unpublish content'
type: node
plugin: entity:unpublish_action:node
configuration: {  }

(at this point of course make sure you've enabled config_update_ui drush en -y config_update_ui)
Import the file we just made with drush
drush cfi system.action.mah_module_unpublish_action

and export configuration with drush cex -y

now the exported version of this file looks like following:

uuid: 44d93317-69d7-489f-bbe6-15c85b78e345
langcode: en
status: true
dependencies:
  module:
    - node
id: mah_module_unpublish_action
label: 'Unpublish content'
type: node
plugin: 'entity:unpublish_action:node'
configuration: {  }

However, if we take a few steps backwards (revert your configuration, disable mah_module) and enable the module when it already had this unpublish action configuration, the configuration after export will look like this.

uuid: 94d36eed-e6e3-425a-bab6-a812b7d37b7a
langcode: en
status: true
dependencies:
  module:
    - node
_core:
  default_config_hash: SsoofwWp0agr81OwbnwhTioQe1knRxnw5d_JoNSdGTA
id: mah_module_unpublish_action
label: 'Unpublish content'
type: node
plugin: 'entity:unpublish_action:node'
configuration: {  }
🐛 Bug report
Status

Needs work

Version

2.0

Component

Base module

Created by

🇫🇮Finland dropa

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024