[2.0.0-beta1] Sources must add dependencies to config entities

Created on 7 July 2024, 5 months ago
Updated 2 August 2024, 5 months ago

Problem/Motivation

When attaching a source plugin to a config entity, the related dependency is not added:

Menu source (for links>

system.menu.account was not added:

--- a/sync/core.entity_view_display.node.article.default.yml
+++ b/sync/core.entity_view_display.node.article.default.yml
@@ -16,6 +16,7 @@ dependencies:
     - layout_builder
     - layout_discovery
     - text
+    - ui_patterns_blocks
     - user
 third_party_settings:
   layout_builder:
@@ -104,6 +105,32 @@ third_party_settings:
                 third_party_settings: {  }
             weight: 4
             additional: {  }
+          84600ccb-2b42-48b5-bbd1-c3088c202a18:
+            uuid: 84600ccb-2b42-48b5-bbd1-c3088c202a18
+            region: content
+            configuration:
+              id: 'ui_patterns_entity:ui_suite_bootstrap:pagination'
+              label: Pagination
+              label_display: visible
+              provider: ui_patterns_blocks
+              context_mapping:
+                entity: layout_builder.entity
+              ui_patterns:
+                component_id: null
+                variant_id:
+                  source_id: select
+                  source:
+                    value: ''
+                slots: {  }
+                props:
+                  items:
+                    source_id: menu
+                    source:
+                      menu: account
+                      level: '1'
+                      depth: '0'
+            weight: 5
+            additional: {  }
         third_party_settings: {  }
 _core:

FieldFomatter source (for slots)

image.style.large was not added to:

--- a/sync/core.entity_view_display.node.article.default.yml
+++ b/sync/core.entity_view_display.node.article.default.yml
@@ -10,7 +10,7 @@ dependencies:
     - node.type.article
   module:
     - layout_builder
-    - text
+    - ui_patterns_field_formatters
     - user
 third_party_settings:
   layout_builder:
@@ -24,9 +24,39 @@ bundle: article
 mode: default
 content:
   body:
-    type: text_default
+    type: ui_patterns_component_per_item
     label: hidden
-    settings: {  }
+    settings:
+      ui_patterns:
+        component_id: 'ui_suite_bootstrap:alert'
+        variant_id:
+          source_id: select
+          source:
+            value: ''
+        props:
+          dismissible:
+            source_id: checkbox
+        slots:
+          message:
+            sources:
+              -
+                source:
+                  derivable_context: 'field:node:article:field_image'
+                  'field:node:article:field_image':
+                    value:
+                      sources:
+                        -
+                          source:
+                            type: image
+                            settings:
+                              image_style: large
+                              image_link: ''
+                              image_loading:
+                                attribute: lazy

Proposed resolution

What are the other sources we need to fix?

Is there an interface to implement? DependentPluginInterface::calculateDependencies?

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇫🇷France pdureau Paris

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024