XB Component config entity's `status` may only be `true` if it meets all of XB's requirements

Created on 10 September 2024, 2 months ago
Updated 17 September 2024, about 2 months ago

Overview

Follow-up for ๐Ÿ“Œ Surface the REASON for an SDC not being made available in XB (i.e. not meeting criteria) Fixed .

Currently checking whether SDC meets requirements happens in Drupal\experience_builder\Plugin\ComponentPluginManager::setCachedDefinitions(). This makes it possible to create via code or config import Component entities for SDC's that do not meet the requirements of Experience Builder.

Proposed resolution

diff --git a/config/schema/experience_builder.schema.yml b/config/schema/experience_builder.schema.yml
index 4a4a84a3..65b2ecb8 100644
--- a/config/schema/experience_builder.schema.yml
+++ b/config/schema/experience_builder.schema.yml
@@ -9,6 +9,10 @@ experience_builder.component.*:
     label:
       type: required_label
       label: 'Label'
+    status:
+      constraints: {
+        # @todo Write validation constraint that verifies that IF this value is `true`, that \Drupal\experience_builder\Plugin\ComponentPluginManager::componentMeetsRequirements() also is met.
+      }
     # @see \Drupal\Core\Plugin\Component::$machineName
     id:
       type: machine_name

Create validation constraint for experience_builder.component.*:status (probably something similar to Drupal\Core\Config\Plugin\Validation\Constraint\LangcodeRequiredIfTranslatableValuesConstraintValidator).

๐Ÿ‘†

๐Ÿ“Œ Task
Status

Needs review

Component

Config management

Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom f.mazeikis Brighton

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