From e5c8bd3dd508b24d33be279d8e3b96f4da423fbc Mon Sep 17 00:00:00 2001 From: Benji Fisher Date: Fri, 9 Feb 2024 20:43:48 -0500 Subject: [PATCH 1/2] Add required plugin annotations --- core/modules/layout_builder/src/Plugin/Layout/BlankLayout.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/modules/layout_builder/src/Plugin/Layout/BlankLayout.php b/core/modules/layout_builder/src/Plugin/Layout/BlankLayout.php index a3f71b0ef9c6..b10c9214598b 100644 --- a/core/modules/layout_builder/src/Plugin/Layout/BlankLayout.php +++ b/core/modules/layout_builder/src/Plugin/Layout/BlankLayout.php @@ -16,6 +16,8 @@ * * @Layout( * id = "layout_builder_blank", + * label = "Blank", + * category = "Blank", * ) */ class BlankLayout extends LayoutDefault { -- GitLab From d5785140fc41fc5dbcb4484ad5bd2c98979fd98b Mon Sep 17 00:00:00 2001 From: Benji Fisher Date: Mon, 19 Feb 2024 10:48:43 -0500 Subject: [PATCH 2/2] Filter out BlankLayout in Layout settings form --- core/lib/Drupal/Core/Layout/LayoutPluginManager.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/lib/Drupal/Core/Layout/LayoutPluginManager.php b/core/lib/Drupal/Core/Layout/LayoutPluginManager.php index 2265194bf30b..f7c8e4c6439b 100644 --- a/core/lib/Drupal/Core/Layout/LayoutPluginManager.php +++ b/core/lib/Drupal/Core/Layout/LayoutPluginManager.php @@ -227,7 +227,8 @@ public function getGroupedDefinitions(array $definitions = NULL, $label_key = 'l */ public function getLayoutOptions() { $layout_options = []; - foreach ($this->getGroupedDefinitions() as $category => $layout_definitions) { + $filtered_definitions = $this->getFilteredDefinitions($this->getType()); + foreach ($this->getGroupedDefinitions($filtered_definitions) as $category => $layout_definitions) { foreach ($layout_definitions as $name => $layout_definition) { $layout_options[$category][$name] = $layout_definition->getLabel(); } -- GitLab