Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Since commit 361215bf9f3cbfb7c50187f464e306b05402239c snippet files are being created during installation.
Though, when installing through config installer, the snippet directory does not exist yet.
Proposed resolution
Create the snippet directory during installation.
Remaining tasks
Write a patch- Review patch
Comment | File | Size | Author |
---|---|---|---|
#2 | google_tag-installation_does_not_work_with_config_installer-2879444-2-8.patch | 2.8 KB | Syndz |
Comments
Comment #2
Syndz CreditAttribution: Syndz at Nedbase commentedHere's a patch that creates the snippets directory during installation.
Comment #3
sluceroThis issue and patch identified and resolved the exact issue I was running into as well with installation errors since introducing the module. Worked great, thanks!
Comment #4
daniel.czegledi CreditAttribution: daniel.czegledi as a volunteer commentedComment #5
solotandem CreditAttribution: solotandem commentedSomeone please explain why config_installer fails to install this module although this task works fine with core. This would seem to be a bug in config_installer which claims to be an "installation profile that takes over the Drupal installer and allows sites to be created from existing configuration". It would seem that config_installer ignores hook_requirements(). If so, why?
Comment #6
Jelle_S@solotandem it's not just config_installer. We have the same issue when this module is enabled by a config import
vendor/bin/drush cim -y
Comment #7
rbayliss CreditAttribution: rbayliss at Last Call Media commentedYeah, I can confirm it's not related to config_installer, too. hook_requirements just seems not to get called before enabling modules using the normal CMI tools (or at least using drush cim).
Comment #8
Jelle_SComment #9
Jelle_SFYI, I just had the same error on D7 when this module was enabled in a
hook_update_N()
of an other (custom) module with module_enable()Comment #10
fagoI ran into a related issue: The files are missing when you sync the dump from another site as well. However, the patch here won't save the problem for this case, only when installed via the config sync. I think a more safe approach would be to create the files on-demand, when missing. See #2843994-12: Warnings when snippets files are missing - create them automatically for a patch which does so.
I'd be inclined to mark this as duplicate of #2843994-12: Warnings when snippets files are missing - create them automatically, but I leave it up to the maintainer or others to decide on the approach taken here.
Comment #12
solotandem CreditAttribution: solotandem commentedThanks to all for the input.