From 40a57efa9552ccd3a5fd18cfd712f232d3b5dc32 Mon Sep 17 00:00:00 2001 From: Nedjo Rogers Date: Sun, 22 Nov 2020 15:22:11 -0800 Subject: [PATCH] GH-313: Layout definitions from patterns lack id property --- modules/ui_patterns_layouts/ui_patterns_layouts.module | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/ui_patterns_layouts/ui_patterns_layouts.module b/modules/ui_patterns_layouts/ui_patterns_layouts.module index 9aa74e55..a43de9f4 100644 --- a/modules/ui_patterns_layouts/ui_patterns_layouts.module +++ b/modules/ui_patterns_layouts/ui_patterns_layouts.module @@ -21,7 +21,9 @@ function ui_patterns_layouts_layout_alter(&$definitions) { // @todo: Use layout deriver instead. // @link https://github.com/nuvoleweb/ui_patterns/issues/94 foreach (UiPatterns::getPatternDefinitions() as $pattern_definition) { + $id = 'pattern_' . $pattern_definition->id(); $definition = [ + 'id' => $id, 'label' => $pattern_definition->getLabel(), 'theme' => $pattern_definition->getThemeHook(), 'provider' => $pattern_definition->getProvider(), @@ -33,7 +35,7 @@ function ui_patterns_layouts_layout_alter(&$definitions) { foreach ($pattern_definition->getFields() as $field) { $definition['regions'][$field->getName()]['label'] = $field->getLabel(); } - $definitions['pattern_' . $pattern_definition->id()] = new LayoutDefinition($definition); + $definitions[$id] = new LayoutDefinition($definition); } }