Score:0

Error about non-existing configuration

de flag

After trying to import configuration with drush cim it returns an error saying

The import failed due to the following reasons:
Configuration core.entity_view_display.contact_message.kontaktujte_nas.default depends on the field.
field.contact_message.kontaktujte_nas.layout_builder__layout configuration that will not exist after import.

What am I doing wrong?

Kevin avatar
in flag
At a glance it sounds like someone configured something on the target environment and that configuration is not tracked. Its saying you are trying to import configuration that will result in the removal of active configuration.
Score:1
in flag

core.entity_view_display.contact_message.kontaktujte_nas.default - this means you have an entity bundle kontaktujte_nas of entity type contact_message, which has Layout Builder enabled on the default display and have enabled the per-entity layout option.

When you enable the per-entity layout option, Layout Builder adds a hidden layout_builder__layout field on that bundle. That field stores the layout configuration for a single entity of that bundle and uses that instead of the layout defined on the type. In your case, that's the field.contact_message.kontaktujte_nas.layout_builder__layout field configuration - you need this file present config during import.

Depending on when you started using Layout Builder, there might be one more configuration file you need in there, a field.storage.contact_message.layout_builder__layout - which defines the DB schema of the layout field (field configs come in pairs, the instance (field.field.*) and the schema config (field.storage.*). The layout field may not have the former because it's not a visible field, but will certainly have the latter.).

Score:0
ua flag

What am I doing wrong?

You or the person that created the config export most likely missed to update and/or commit one of those two config files.

To check if this is the case, go to live site and run drush cex you shouldn't see anything to update. (If there is, just cancel out as your config should be pushed via Git, assuming you're using a Git workflow). This would mean you will have to pull latest code & DB from live to your local and then do a "config sync" (drush cex) and push to live.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.