- Issue created by @thejimbirch
- Merge request !8646Changes the standard recipes to use createIfNotExists β (Open) created by thejimbirch
- Status changed to Needs review
5 months ago 1:53pm 3 July 2024 - πΊπΈUnited States thejimbirch Cape Cod, Massachusetts
Drupal core' Standard recipes have been converted from importing configuration from the /config folder, to being created only if they do not exist via the
createIfNotExists
config action. This allows multiple recipes to depend on, and build upon these recipes.To validate, apply each recipe twice.
- Status changed to Needs work
5 months ago 2:29pm 5 July 2024 - πΊπΈUnited States smustgrave
Appears the standard install recipe test is failing.
- πΊπΈUnited States thejimbirch Cape Cod, Massachusetts
Adding some ideas for tests. This is the first. If I try applying core's recipes to a site that has been created with the standard profile, or re-applying recipes, I get the following errors:
1. Install Standard
2. Apply core/recipes/article_comment
The configuration 'core.entity_form_display.node.article.default' exists already and does not match the recipe's configuration
3. Apply core/recipes/article_tags
The configuration 'core.entity_form_display.node.article.default' exists already and does not match the recipe's configuration
4. Apply core/recipes/basic_block_type
The configuration 'field.field.block_content.basic.body' exists already and does not match the recipe's configuration
5. Apply core/recipes/basic_html_format_editor
The configuration 'filter.format.basic_html' exists already and does not match the recipe's configuration
6. Apply core/recipes/comment_base
The configuration 'field.field.comment.comment.comment_body' exists already and does not match the recipe's configuration
7. Apply core/recipes/core_recommended_admin_theme
The configuration 'system.theme' exists already and does not match the recipe's configuration
8. Apply core/recipes/core_recommended_front_end_theme
The configuration 'system.theme' exists already and does not match the recipe's configuration
8. Apply core/recipes/feedback_contact_form
The configuration 'contact.form.feedback' exists already and does not match the recipe's configuration
9. Apply core/recipes/full_html_format_editor
The configuration 'filter.format.full_html' exists already and does not match the recipe's configuration
10. Apply core/recipes/page_content_type
The configuration 'field.field.node.page.body' exists already and does not match the recipe's configuration
11. Apply core/recipes/standard
The configuration 'field.field.block_content.basic.body' exists already and does not match the recipe's configuration
12. Apply core/recipes/standard_responsive_images
The configuration 'image.style.max_1300x1300' exists already and does not match the recipe's configuration
13. Apply core/recipes/tags_taxonomy
The configuration 'taxonomy.vocabulary.tags' exists already and does not match the recipe's configuration
- π¨π¦Canada Liam Morland Ontario, CA π¨π¦
There are couple of problems here:
Drupal does not recognize when the config is identical. I wrote a recipe and applied it. When I immediately tried to apply it again, I got "The configuration 'CONFIG_ID' exists already and does not match the recipe's configuration". The config cannot have actually changed. I suspect this is because of key order, which often makes big diffs on config export even when nothing has changed.
When applying a recipe, I should be able to overwrite the existing config. The point of applying a recipe is to get the config to be a particular way. If the config exists but is different from what the recipe calls for, I should have the option to have the site use the recipe's version. It should probably be the default to do this this way. Otherwise, Drupal will say that the recipe has been installed when in fact at least some of what the recipe calls for will not have been done.
- πΊπΈUnited States thejimbirch Cape Cod, Massachusetts
@liam
Take a look at π Recipes' imported config is validated too strictly by default Active that was just added to 10.4 and 11. That provides more leniency for configuration files from modules and the config folder.
This issue should be closed as the referenced issue is a much better solution than using createIfNotExists as it is a pretty dumb config action and really only checks for existence of the ID/config file itself, not the actual attributes in the file.
- π¨π¦Canada Liam Morland Ontario, CA π¨π¦
Thanks for your reply, @thejimbirch.
I have opened a ticket regarding the first issue I mention in #7; see π Drupal does not recognize when the config is identical Active .
Regarding the second issue, I write about a possible solution in #3478669-5: Consider making recipes' comparison with existing config lenient by default β .