From fe1637f1396630ee6dbefb1306abd56d5249ae24 Mon Sep 17 00:00:00 2001
From: Seth Hill <53914-sethhill@users.noreply.drupalcode.org>
Date: Fri, 26 Jul 2024 16:42:05 +0000
Subject: [PATCH] Issue #3359174 by sethhill, marjina-constantin: Form state
 errors break nested layout paragraphs dialog

---
 src/Form/ComponentFormBase.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Form/ComponentFormBase.php b/src/Form/ComponentFormBase.php
index ff463f2..f8e6079 100644
--- a/src/Form/ComponentFormBase.php
+++ b/src/Form/ComponentFormBase.php
@@ -373,7 +373,7 @@ abstract class ComponentFormBase extends FormBase implements ComponentFormInterf
    *   The form element.
    */
   public function afterBuild(array $element, FormStateInterface $form_state) {
-    $parents = array_merge($element['#parents'], [$this->getFormId()]);
+    $parents = array_merge($element['#parents'], [$this->getFormId(), $element['#paragraph']->bundle()]);
     $unprocessed_id = 'edit-' . implode('-', $parents);
     $element['#attributes']['data-drupal-selector'] = Html::getId($unprocessed_id);
     $element['#dialog_id'] = $unprocessed_id . '-dialog';
-- 
GitLab