Skip to content

Commit

Permalink
nuvolewebGH-313: Layout definitions from patterns lack id property
Browse files Browse the repository at this point in the history
  • Loading branch information
Nedjo Rogers committed Nov 22, 2020
1 parent cd03369 commit 40a57ef
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/ui_patterns_layouts/ui_patterns_layouts.module
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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);
}
}

Expand Down

0 comments on commit 40a57ef

Please sign in to comment.