From 143a0d0f5a6d27af65e8b2c8d95e00ea7414feec Mon Sep 17 00:00:00 2001 From: Bartek Wajda Date: Wed, 1 Feb 2023 17:22:11 +0100 Subject: [PATCH] IBX-4796: Removed `referrerLocation` from `nodraft` actions --- src/lib/Form/Processor/ContentFormProcessor.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/Form/Processor/ContentFormProcessor.php b/src/lib/Form/Processor/ContentFormProcessor.php index 849871a..a0c0a4d 100644 --- a/src/lib/Form/Processor/ContentFormProcessor.php +++ b/src/lib/Form/Processor/ContentFormProcessor.php @@ -126,7 +126,9 @@ public function processPublish(FormActionEvent $event) $event->setPayload('content', $content); $event->setPayload('is_new', $draft->contentInfo->isDraft()); - $locationId = $referrerLocation !== null ? $referrerLocation->id : $content->contentInfo->mainLocationId; + $locationId = $referrerLocation !== null && $data instanceof ContentUpdateData + ? $referrerLocation->id + : $content->contentInfo->mainLocationId; $redirectUrl = $form['redirectUrlAfterPublish']->getData() ?: $this->router->generate( '_ez_content_view', [