Skip to content

Commit

Permalink
SDSS-000: Added patch to drop layout paragraph restrictions from stan…
Browse files Browse the repository at this point in the history
…ford_layout_paragraphs (#358)

* SDSS-000: Added patch to drop layout paragraph restrictions from stanford_layout_paragraphs.
  • Loading branch information
joegl authored Feb 2, 2024
1 parent 22d85c6 commit 50ba8bf
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,9 @@
},
"drupal/ui_patterns": {
"Ui Patterns Views Fixes": "patches/contrib/ui_patterns_views-preview.patch"
},
"su-sws/stanford_profile_helper": {
"Remove paragraph layout restrictions from stanford_layout_paragraphs": "patches/stanford/stanford_layout_paragraphs.patch"
}
}
},
Expand Down
23 changes: 23 additions & 0 deletions patches/stanford/stanford_layout_paragraphs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/modules/stanford_layout_paragraphs/src/EventSubscriber/StanfordLayoutParagraphsSubscriber.php b/modules/stanford_layout_paragraphs/src/EventSubscriber/StanfordLayoutParagraphsSubscriber.php
@@ -44,21 +44,7 @@
* Layout paragraphs event.
*/
public function layoutParagraphsAllowedTypes(LayoutParagraphsAllowedTypesEvent $event): void {
- $parent_component = $event->getLayout()
- ->getComponentByUuid($event->getParentUuid());

- // If adding a new layout, it won't have a parent.
- if ($parent_component) {
-
- $layout_settings = $parent_component->getSettings();
- $layout_regions = $this->layoutManager
- ->getDefinition($layout_settings['layout'])->getRegions();
- if (count($layout_regions) > 1) {
- $types = $event->getTypes();
- unset($types['stanford_banner'], $types['stanford_gallery']);
- $event->setTypes($types);
- }
- }
}

}

0 comments on commit 50ba8bf

Please sign in to comment.