One would expect to be able to copy the yaml of a webform into a module's config/install folder, remove the uuid, and import it using config_devel's cdi command, as you can with other configurations. However, it fails due to a bogus uuid conflict because:

1) ConfigDevelAutoImportSubscriber::importOne() first creates the new entity and THEN loads the existing one to set the new entity's uuid (if absent) from the existing one.

2) WebformEntityStorage::doCreate() caches the newly-created entity, even though it hasn't been saved yet.

3) Therefore importOne() retrieves the entity it just created, rather than the existing one. The uuid in the new entity is updated to match the existing entity.

4) This could be fixed by having config_devel load the existing entity before creating the new one. Or maybe webform shouldn't be caching an entity that hasn't actually been saved yet?

Feel free to move to the config_devel issue queue if appropriate.

CommentFileSizeAuthor
#2 3059507-2.patch624 bytesjrockowitz

Comments

DanChadwick created an issue. See original summary.

jrockowitz’s picture

Status: Active » Needs review
StatusFileSize
new624 bytes

Does the attached patch solve the problem?

danchadwick’s picture

Status: Needs review » Reviewed & tested by the community

Yes. Assuming you've tested the case where caching is needed, this is RTBC.

Thank you for your near-instantaneous response to this minor issue. Much gratitude.

  • jrockowitz committed f75658e on 8.x-5.x
    Issue #3059507 by jrockowitz: Webform is incompatible with config_devel...
jrockowitz’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.