From 0c7224ab46ec05f4d059e3983e957f36075b4d9c Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Mon, 21 Oct 2024 13:49:50 +0100
Subject: [PATCH] Issue #3481751 by phenaproxima, thejimbirch: Opt some core
 recipes out of strict config comparisons

(cherry picked from commit d177974f8544cfb90bebe3b8ec21671a2252030c)
---
 core/recipes/article_comment/recipe.yml                  | 3 +++
 core/recipes/article_content_type/recipe.yml             | 4 ++++
 core/recipes/article_tags/recipe.yml                     | 3 +++
 core/recipes/audio_media_type/recipe.yml                 | 3 +++
 core/recipes/basic_block_type/recipe.yml                 | 3 +++
 core/recipes/basic_html_format_editor/recipe.yml         | 2 ++
 core/recipes/comment_base/recipe.yml                     | 4 ++++
 core/recipes/content_search/recipe.yml                   | 6 ++----
 core/recipes/core_recommended_admin_theme/recipe.yml     | 2 ++
 core/recipes/core_recommended_front_end_theme/recipe.yml | 2 ++
 core/recipes/core_recommended_maintenance/recipe.yml     | 2 ++
 core/recipes/document_media_type/recipe.yml              | 3 +++
 core/recipes/editorial_workflow/recipe.yml               | 3 +++
 core/recipes/feedback_contact_form/recipe.yml            | 2 ++
 core/recipes/full_html_format_editor/recipe.yml          | 3 +++
 core/recipes/image_media_type/recipe.yml                 | 3 +++
 core/recipes/local_video_media_type/recipe.yml           | 3 +++
 core/recipes/page_content_type/recipe.yml                | 3 +++
 core/recipes/remote_video_media_type/recipe.yml          | 3 +++
 core/recipes/restricted_html_format/recipe.yml           | 2 ++
 core/recipes/standard/recipe.yml                         | 4 ++++
 core/recipes/standard_responsive_images/recipe.yml       | 2 ++
 core/recipes/tags_taxonomy/recipe.yml                    | 2 ++
 core/recipes/user_picture/recipe.yml                     | 3 +++
 24 files changed, 66 insertions(+), 4 deletions(-)

diff --git a/core/recipes/article_comment/recipe.yml b/core/recipes/article_comment/recipe.yml
index f4ac4e4be49a..757072fa3b73 100644
--- a/core/recipes/article_comment/recipe.yml
+++ b/core/recipes/article_comment/recipe.yml
@@ -5,6 +5,9 @@ recipes:
   - article_content_type
   - comment_base
 config:
+  # If the `comment` field already exists, it is guaranteed to be the right
+  # field type because the comment_base recipe treats the field storage strictly.
+  strict: false
   actions:
     core.entity_form_display.node.article.default:
       setComponent:
diff --git a/core/recipes/article_content_type/recipe.yml b/core/recipes/article_content_type/recipe.yml
index dfd4371c0c85..fc7d77a88ea1 100644
--- a/core/recipes/article_content_type/recipe.yml
+++ b/core/recipes/article_content_type/recipe.yml
@@ -6,6 +6,10 @@ install:
   - node
   - path
 config:
+  strict:
+    # Treat field storages strictly, since they influence the database layout.
+    - field.storage.node.body
+    - field.storage.node.field_image
   import:
     node:
       # Only import config which is also imported by the Standard profile.
diff --git a/core/recipes/article_tags/recipe.yml b/core/recipes/article_tags/recipe.yml
index 59566afecb79..68f2c01b843c 100644
--- a/core/recipes/article_tags/recipe.yml
+++ b/core/recipes/article_tags/recipe.yml
@@ -7,6 +7,9 @@ recipes:
 install:
   - views
 config:
+  strict:
+    # Treat field storages strictly, since they influence the database layout.
+    - field.storage.node.field_tags
   import:
     taxonomy:
       - views.view.taxonomy_term
diff --git a/core/recipes/audio_media_type/recipe.yml b/core/recipes/audio_media_type/recipe.yml
index bd86d21d8194..196a2c4501c2 100644
--- a/core/recipes/audio_media_type/recipe.yml
+++ b/core/recipes/audio_media_type/recipe.yml
@@ -7,6 +7,9 @@ install:
   - path
   - views
 config:
+  strict:
+    # Treat field storages strictly, since they influence the database layout.
+    - field.storage.media.field_media_audio_file
   import:
     file:
       - views.view.files
diff --git a/core/recipes/basic_block_type/recipe.yml b/core/recipes/basic_block_type/recipe.yml
index d1d7fa8755e2..6fc0500a2380 100644
--- a/core/recipes/basic_block_type/recipe.yml
+++ b/core/recipes/basic_block_type/recipe.yml
@@ -5,6 +5,9 @@ install:
   - block_content
   - views
 config:
+  strict:
+    # Treat field storages strictly, since they influence the database layout.
+    - field.storage.block_content.body
   import:
     block_content:
       - field.storage.block_content.body
diff --git a/core/recipes/basic_html_format_editor/recipe.yml b/core/recipes/basic_html_format_editor/recipe.yml
index d1e5e6ec8ca6..71ac24b1e0b9 100644
--- a/core/recipes/basic_html_format_editor/recipe.yml
+++ b/core/recipes/basic_html_format_editor/recipe.yml
@@ -4,6 +4,8 @@ type: 'Text format editor'
 install:
   - ckeditor5
 config:
+  # If the basic_html format and editor already exist, leave them as-is.
+  strict: false
   actions:
     user.role.authenticated:
       grantPermission: 'use text format basic_html'
diff --git a/core/recipes/comment_base/recipe.yml b/core/recipes/comment_base/recipe.yml
index 0cf967155a41..0f09d5aadd34 100644
--- a/core/recipes/comment_base/recipe.yml
+++ b/core/recipes/comment_base/recipe.yml
@@ -6,6 +6,10 @@ install:
   - node
   - views
 config:
+  strict:
+    # Treat field storages strictly, since they influence the database layout.
+    - field.storage.comment.comment_body
+    - field.storage.node.comment
   import:
     comment:
       - core.entity_view_mode.comment.full
diff --git a/core/recipes/content_search/recipe.yml b/core/recipes/content_search/recipe.yml
index b9f60c59a7f1..800c5777bef4 100644
--- a/core/recipes/content_search/recipe.yml
+++ b/core/recipes/content_search/recipe.yml
@@ -12,8 +12,6 @@ config:
       - search.page.node_search
   actions:
     user.role.anonymous:
-      grantPermissions:
-        - 'search content'
+      grantPermission: 'search content'
     user.role.authenticated:
-      grantPermissions:
-        - 'search content'
+      grantPermission: 'search content'
diff --git a/core/recipes/core_recommended_admin_theme/recipe.yml b/core/recipes/core_recommended_admin_theme/recipe.yml
index 046f5a27fc65..61cd28e17c9c 100644
--- a/core/recipes/core_recommended_admin_theme/recipe.yml
+++ b/core/recipes/core_recommended_admin_theme/recipe.yml
@@ -5,6 +5,8 @@ install:
   - claro
   - block
 config:
+  # Leave existing blocks and menus as-is.
+  strict: false
   import:
     system:
       - system.menu.account
diff --git a/core/recipes/core_recommended_front_end_theme/recipe.yml b/core/recipes/core_recommended_front_end_theme/recipe.yml
index a7b2e26f40d6..00faf6409ec5 100644
--- a/core/recipes/core_recommended_front_end_theme/recipe.yml
+++ b/core/recipes/core_recommended_front_end_theme/recipe.yml
@@ -5,6 +5,8 @@ install:
   - olivero
   - block
 config:
+  # Leave existing blocks and menus as-is.
+  strict: false
   import:
     system:
       - system.menu.account
diff --git a/core/recipes/core_recommended_maintenance/recipe.yml b/core/recipes/core_recommended_maintenance/recipe.yml
index ef6ad24ee645..2833c9f69c59 100644
--- a/core/recipes/core_recommended_maintenance/recipe.yml
+++ b/core/recipes/core_recommended_maintenance/recipe.yml
@@ -7,6 +7,8 @@ install:
   - dblog
   - views
 config:
+  # Leave existing config as-is.
+  strict: false
   import:
     automated_cron:
       - automated_cron.settings
diff --git a/core/recipes/document_media_type/recipe.yml b/core/recipes/document_media_type/recipe.yml
index 868610953e09..44dd72715ba7 100644
--- a/core/recipes/document_media_type/recipe.yml
+++ b/core/recipes/document_media_type/recipe.yml
@@ -6,6 +6,9 @@ install:
   - path
   - views
 config:
+  strict:
+    # Treat field storages strictly, since they influence the database layout.
+    - field.storage.media.field_media_document
   import:
     file:
       - views.view.files
diff --git a/core/recipes/editorial_workflow/recipe.yml b/core/recipes/editorial_workflow/recipe.yml
index baa7f86de7f2..9ad375264377 100644
--- a/core/recipes/editorial_workflow/recipe.yml
+++ b/core/recipes/editorial_workflow/recipe.yml
@@ -7,6 +7,9 @@ install:
   - node
   - views
 config:
+  # If the config we're shipping already exists, we don't really care what
+  # it looks like.
+  strict: false
   import:
     content_moderation:
       - views.view.moderated_content
diff --git a/core/recipes/feedback_contact_form/recipe.yml b/core/recipes/feedback_contact_form/recipe.yml
index 5940cf4a6b93..084f2712537c 100644
--- a/core/recipes/feedback_contact_form/recipe.yml
+++ b/core/recipes/feedback_contact_form/recipe.yml
@@ -17,6 +17,8 @@ input:
       source: config
       config: ['system.site', 'mail']
 config:
+  # Don't conflict with existing configuration.
+  strict: false
   import:
     contact:
       - contact.form.personal
diff --git a/core/recipes/full_html_format_editor/recipe.yml b/core/recipes/full_html_format_editor/recipe.yml
index 171c75ac7b81..a8e669e19660 100644
--- a/core/recipes/full_html_format_editor/recipe.yml
+++ b/core/recipes/full_html_format_editor/recipe.yml
@@ -3,3 +3,6 @@ description: 'Provides "Full HTML" text format along with WYSIWYG editor and rel
 type: 'Text format editor'
 install:
   - ckeditor5
+config:
+  # If the full_html format and editor already exist, leave them as-is.
+  strict: false
diff --git a/core/recipes/image_media_type/recipe.yml b/core/recipes/image_media_type/recipe.yml
index 9fe216304945..d516854f836e 100644
--- a/core/recipes/image_media_type/recipe.yml
+++ b/core/recipes/image_media_type/recipe.yml
@@ -6,6 +6,9 @@ install:
   - path
   - views
 config:
+  strict:
+    # Treat field storages strictly, since they influence the database layout.
+    - field.storage.media.field_media_image
   import:
     file:
       - views.view.files
diff --git a/core/recipes/local_video_media_type/recipe.yml b/core/recipes/local_video_media_type/recipe.yml
index 8bb1c6f6f630..270be6e56316 100644
--- a/core/recipes/local_video_media_type/recipe.yml
+++ b/core/recipes/local_video_media_type/recipe.yml
@@ -6,6 +6,9 @@ install:
   - path
   - views
 config:
+  strict:
+    # Treat field storages strictly, since they influence the database layout.
+    - field.storage.media.field_media_video_file
   import:
     file:
       - views.view.files
diff --git a/core/recipes/page_content_type/recipe.yml b/core/recipes/page_content_type/recipe.yml
index e9193c024f27..805e6cce316b 100644
--- a/core/recipes/page_content_type/recipe.yml
+++ b/core/recipes/page_content_type/recipe.yml
@@ -5,6 +5,9 @@ install:
   - node
   - path
 config:
+  strict:
+    # Treat field storages strictly, since they influence the database layout.
+    - field.storage.node.body
   import:
     node:
       - core.entity_view_mode.node.full
diff --git a/core/recipes/remote_video_media_type/recipe.yml b/core/recipes/remote_video_media_type/recipe.yml
index fd6d9cd02b12..3ab591c7f952 100644
--- a/core/recipes/remote_video_media_type/recipe.yml
+++ b/core/recipes/remote_video_media_type/recipe.yml
@@ -6,6 +6,9 @@ install:
   - path
   - views
 config:
+  strict:
+    # Treat field storages strictly, since they influence the database layout.
+    - field.storage.media.field_media_oembed_video
   import:
     media_library:
       - core.entity_view_mode.media.media_library
diff --git a/core/recipes/restricted_html_format/recipe.yml b/core/recipes/restricted_html_format/recipe.yml
index 8aec764918f9..46dca71dbe84 100644
--- a/core/recipes/restricted_html_format/recipe.yml
+++ b/core/recipes/restricted_html_format/recipe.yml
@@ -4,6 +4,8 @@ type: 'Text format'
 install:
   - filter
 config:
+  # If the restricted_html format already exists, leave it as-is.
+  strict: false
   import:
     filter: '*'
   actions:
diff --git a/core/recipes/standard/recipe.yml b/core/recipes/standard/recipe.yml
index 6d67b270d18e..7960d7f0948f 100644
--- a/core/recipes/standard/recipe.yml
+++ b/core/recipes/standard/recipe.yml
@@ -36,6 +36,10 @@ install:
   - views_ui
   - shortcut
 config:
+  # This recipe is intended to set up a full site from scratch, fulfilling certain
+  # expectations. It's not really designed to be a building block. Therefore, treat
+  # all of the config strictly.
+  strict: true
   import:
     claro:
       - block.block.claro_help
diff --git a/core/recipes/standard_responsive_images/recipe.yml b/core/recipes/standard_responsive_images/recipe.yml
index 8175e8de0aca..d238fb84cd3f 100644
--- a/core/recipes/standard_responsive_images/recipe.yml
+++ b/core/recipes/standard_responsive_images/recipe.yml
@@ -4,5 +4,7 @@ type: 'Responsive image'
 install:
   - responsive_image
 config:
+  # There's no need to conflict with existing responsive image styles.
+  strict: false
   import:
     image: '*'
diff --git a/core/recipes/tags_taxonomy/recipe.yml b/core/recipes/tags_taxonomy/recipe.yml
index 71bc5e3a9bbd..7a38c9d67bd5 100644
--- a/core/recipes/tags_taxonomy/recipe.yml
+++ b/core/recipes/tags_taxonomy/recipe.yml
@@ -8,5 +8,7 @@ install:
   # https://www.drupal.org/project/drupal/issues/3479980
   - views
 config:
+  # If the `tags` vocabulary already exists, there's no need to conflict with it.
+  strict: false
   import:
     taxonomy: '*'
diff --git a/core/recipes/user_picture/recipe.yml b/core/recipes/user_picture/recipe.yml
index 773e6b771185..93f348ca2110 100644
--- a/core/recipes/user_picture/recipe.yml
+++ b/core/recipes/user_picture/recipe.yml
@@ -5,6 +5,9 @@ install:
   - image
   - user
 config:
+  strict:
+    # Treat field storages strictly, since they influence the database layout.
+    - field.storage.user.user_picture
   import:
     image:
       - image.style.thumbnail
-- 
GitLab