I have a module that have some config in config/install folder, that require config that may already exist in the current config. So I placed those config under config/optional.
But if those config does not exist, they are not installed and the module installation throw an error for unmet dependancies.
What can I do to have a module that have dependancies on config that may exist ?
Thanks.
More information:
Under config/install :
core.entity_view_display.user.user.teaser_resource.yml
langcode: fr
status: true
dependencies:
config:
- core.entity_view_mode.user.teaser_resource
- field.field.user.user.field_firstname
- field.field.user.user.user_picture
module:
- user
id: user.user.teaser_resource
targetEntityType: user
bundle: user
mode: teaser_resource
content:
field_firstname:
type: string
label: hidden
settings:
link_to_entity: false
third_party_settings: { }
weight: 0
region: content
hidden:
langcode: true
member_for: true
realname: true
search_api_excerpt: true
user_picture: true
Under config/optional: field.field.user.user.field_firstname.yml
langcode: fr
status: true
dependencies:
config:
- field.storage.user.field_firstname
module:
- user
id: user.user.field_firstname
field_name: field_firstname
entity_type: user
bundle: user
label: Prénom
description: ''
required: true
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: string
(field.storage.user.field_firstname.yml is also there)
The error is :
Unable to install Custom Module due to unmet dependencies: core.entity_view_display.user.user.teaser_resource (field.field.user.user.field_firstname)