Score:-2

Can't import webform settings after creating / testing a form

in flag

On server I already have site setup with webform module installed. If I i.e. create and test some webform and after that try to import webform configuration with drush cim I get error:

"There are entities of the type Webform submission and Webform Kontakt form These entities must be deleted before importing".

That issue is also reported here: https://www.drupal.org/project/webform/issues/3076341 But I didn't find solution for it yet.

And by: https://www.jrockowitz.com/blog/managing-webform-configuration Webforms should be configuration entities.

So any idea why is this happening and how to solve the issue?

Score:1
cn flag

What you're describing sounds inevitable to me.

You've created a configuration entity (webform), you haven't exported it, and now you're running a config import. Drupal is syncing your config, so correctly tries to delete the webform because it isn't in the config you've told it to import.

The webform however has submissions, so can't be deleted, hence the error message.

Available solutions are:

  1. Export the config for your new webform before trying the config import again.
  2. Delete the submissions so the webform can be deleted by the import.
  3. Add a suitable config ignore pattern so your work-in-progress webforms aren't considered during config imports
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.