From 50ba8bf0830ac2d4f8cdf262f8fc13d32e656c35 Mon Sep 17 00:00:00 2001 From: Joe Gilliland-Lloyd <6943710+joegl@users.noreply.github.com> Date: Fri, 2 Feb 2024 14:07:41 -0600 Subject: [PATCH] SDSS-000: Added patch to drop layout paragraph restrictions from stanford_layout_paragraphs (#358) * SDSS-000: Added patch to drop layout paragraph restrictions from stanford_layout_paragraphs. --- composer.json | 3 +++ .../stanford/stanford_layout_paragraphs.patch | 23 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 patches/stanford/stanford_layout_paragraphs.patch diff --git a/composer.json b/composer.json index dca39c870..3e4ea0388 100644 --- a/composer.json +++ b/composer.json @@ -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" } } }, diff --git a/patches/stanford/stanford_layout_paragraphs.patch b/patches/stanford/stanford_layout_paragraphs.patch new file mode 100644 index 000000000..7522c1891 --- /dev/null +++ b/patches/stanford/stanford_layout_paragraphs.patch @@ -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); +- } +- } + } + + }