1

I have a custom module which defines configuration for blue_article content type using the following file:

modules/custom/blue_article/config/install/node.type.blue_article.yml:

langcode: en
status: true
dependencies:
  module:
    - menu_ui
third_party_settings:
  menu_ui:
    available_menus:
      - main
    parent: 'main:'
name: 'Article'
type: blue_article
description: 'Standard article for Blue sites'
help: ''
new_revision: false
preview_mode: 1
display_submitted: false

However I have another custom module which provides configuration settings for Workbench Moderation module. The idea is that if I enable this module, then the 'blue_article' content type should be updated to include the workbench moderation settings. I have added a configuration file to the blue_workbench_moderation custom module.

modules/custom/blue_workbench_moderation/config/install/node.type.blue_article.yml:

langcode: en
status: true
dependencies:
  module:
    - menu_ui
    - workbench_moderation
third_party_settings:
  menu_ui:
    available_menus:
      - main
    parent: 'main:'
  workbench_moderation:
    enabled: true
    allowed_moderation_states:
      - draft
      - needs_review
      - published
    default_moderation_state: draft
name: Article
type: blue_article
description: 'Standard article for Blue sites'
help: ''
new_revision: false
preview_mode: 1
display_submitted: false

If I enable the blue_workbench_moderation module after the blue_article module is enabled, I get the following error:

Drupal\Core\Config\PreExistingConfigException: Configuration objects (node.type.blue_article) provided by blue_workbench_moderation already exist in active configuration

How can I resolve this? What is the recommended method of updating the blue_article content type configuration to include workbench moderation settings when I enable blue_workbench_moderation module?

1
  • 2
    Configuration of another module can be changed only programmatically(\Drupal::configFactory()->getEditable('config.name')...
    – user21641
    Mar 3, 2016 at 10:37

0

Browse other questions tagged or ask your own question.