Follow-up to #2833562-10: Installing modules using the ConfigImporter does not work
Problem/Motivation
There was introduced special event #2361423: Add a step to config import to allow contrib to create content based on config dependencies to handle missing content when config import finishing.
The parent issue allows to install default content fixtures for newly installed modules but in case of block content config it may need to import missing content entities instead of all module's default content
Proposed resolution
Add handling of the event to add missing content after config import
Remaining tasks
Reviews needed.
User interface changes
None
API changes
None
Comment | File | Size | Author |
---|---|---|---|
#2 | 2849128-config-import-2.patch | 3.38 KB | andypost |
|
Issue fork default_content-2849128
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
andypostInitial stub on it, discovery still needs proper implementation
Comment #3
tstoecklerI think this is problematic. While Default Content exports content with the .json filename by default, it supports renaming the files to something more semantic just fine.
As far as I can tell, the only way to reliably find the UUID is to actually parse the file.
Comment #4
basil_snowman CreditAttribution: basil_snowman as a volunteer and for Skilld commentedThis construction does not work. Need change method importContent() into DefaultContentManager.
Comment #5
andypostI think we need to iterate only inside uuids that defined in module's info.yml "default_content" key
otoh it require to iterate over all modules and their files to find how many of exported files has this uuid inside, so could be disk intensive operation
Comment #6
basil_snowman CreditAttribution: basil_snowman as a volunteer and for Skilld commentedComment #7
andypostI used to write scanner and looks it's not so slow, so now it needs to unserialize from files and select latest if any changed property exists
https://github.com/andypost/default_content/blob/ui/default_content_ui/s...
Comment #8
andypostit still needs
- scanner to locate files
- import entity with dependencies
Comment #10
alexpottLet's solve this in 2.0.x
Comment #12
alexpottThe approach in the MR relies on #3414993: Add ConfigImporter to \Drupal\Core\Config\Importer\MissingContentEvent
Comment #13
andypostCore issues merged to 10.2 so the issue unblocked!
Comment #14
andypostAs reverted #3414993: Add ConfigImporter to \Drupal\Core\Config\Importer\MissingContentEvent