From 64d5a6ca82248ad382508ddf4ad2a2d8e1bc125a Mon Sep 17 00:00:00 2001
From: Artem  Dmitriiev <a.dmitriiev@1xinternet.de>
Date: Mon, 6 Jan 2025 16:39:29 +0100
Subject: [PATCH] Issue #3497561: Change paragraph delete form cancel url

---
 src/Form/ParagraphDeleteForm.php | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/Form/ParagraphDeleteForm.php b/src/Form/ParagraphDeleteForm.php
index 306560e..a94eb61 100644
--- a/src/Form/ParagraphDeleteForm.php
+++ b/src/Form/ParagraphDeleteForm.php
@@ -46,10 +46,7 @@ class ParagraphDeleteForm extends ParagraphDeleteFormBase {
    * {@inheritdoc}
    */
   public function getCancelUrl() {
-    /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
-    $paragraph = $this->getEntity();
-    $entity = $this->lineageInspector()->getRootParent($paragraph);
-    return $entity->hasLinkTemplate('canonical') ? $entity->toUrl() : Url::fromRoute('<front>');
+    return Url::fromRoute('frontend_editing.form', ['type' => 'paragraph', 'id' => $this->getEntity()->id()]);
   }
 
 }
-- 
GitLab