Problem/Motivation
Split off from #1740378: Implement renames in the import cycle.
Handle importing configuration entities with the same ID but a different UUID. This can occur when someone creates a view called views.view.content_list and then sync this to their production site. On the development site they then decide to the delete the view and create a new view called views.view.content_list.
Proposed resolution
The storage comparer needs to detect this situation and instead of adding the configuration name to the update changelist add it to both the delete and create changelists.
Remaining tasks
This patch is blocked on #2124535: Prevent secondary configuration creates and deletes from breaking the ConfigImporter since secondary deletes are occuring.
User interface changes
None
API changes
None
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 2224873.10.patch | 6.93 KB | alexpott |
| #10 | 9-10-interdiff.txt | 840 bytes | alexpott |
| #9 | 2224873.9.patch | 6.93 KB | alexpott |
| #9 | 6-9-interdiff.txt | 1.4 KB | alexpott |
| #6 | 5-6-interdiff.txt | 3.33 KB | alexpott |
Comments
Comment #1
Anonymous (not verified) commentedComment #2
tim.plunkettThis, from ConfigEntityBase::preSave()
That made some amount of sense to me. Now we want to blow away the original entity with something potentially completely different?
Comment #3
Anonymous (not verified) commentedre #2, this will happen 'outside' the config entity system somewhat.
when computing the change list, we'll compare UUIDs, and if we have an entity with the same name but different UUIDs, we'll add the name to the delete and create lists. so, the code snippet in #2 will not need to change.
Comment #4
tim.plunkettAll other beta blockers are critical.
I don't fully understand this one yet.
Comment #5
alexpottThis blocked on #2124535: Prevent secondary configuration creates and deletes from breaking the ConfigImporter as the test it adds nicely illustrates the problem we have. Once all the field instances are deleted the field system helpfully deletes the fields :) the config importer then tries to delete the field - which no longer exists.
Comment #6
alexpottFixed FieldInstanceConfig to not do secondary deletes if a config sync is taking place and improved the test.
Comment #7
Anonymous (not verified) commentedthis looks good to me.
i don't understand the views snippets though, otherwise i'd RTBC it.
Comment #8
swentel commented'the the'
entity_entity_bundle_delete() does this too ...
Comment #9
alexpottInterestingly the order modules are enabled in DUBT tests matters! Changing the order to match how it would be in a real drupal install means the entity_entity_bundle_rename is fired before field_entity_bundle_rename and everything works as expected. Going to raise a follow up issue about DUBT module ordering and NodeType::postDelete removing field instances and entity displays. This needs to be done in preDelete since a field instance should never exist for a bundle that does not exist.
Comment #10
alexpottMissed point 1. from @swentel's review
Comment #11
Anonymous (not verified) commentedlooks ready to me.
Comment #15
alexpottThe fail in
Drupal\image\Tests\ImageStylesPathAndUrlTestis unrelated.Comment #16
alexpott10: 2224873.10.patch queued for re-testing.
Comment #17
alexpottThe test fails were unrelated to the patch - putting back to rtbc as per #10
Comment #18
catchCommitted/pushed to 8.x, thanks!