From 160a3fe86e792171b428e498113912e521d23bbe Mon Sep 17 00:00:00 2001 From: Bartek Wajda Date: Wed, 18 Jan 2023 11:08:17 +0100 Subject: [PATCH] IBX-4796: CS --- src/lib/Form/Processor/ContentFormProcessor.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/Form/Processor/ContentFormProcessor.php b/src/lib/Form/Processor/ContentFormProcessor.php index f8d048b..b172621 100644 --- a/src/lib/Form/Processor/ContentFormProcessor.php +++ b/src/lib/Form/Processor/ContentFormProcessor.php @@ -126,12 +126,12 @@ public function processPublish(FormActionEvent $event) $event->setPayload('content', $content); $event->setPayload('is_new', $draft->contentInfo->isDraft()); + $locationId = !empty($referrerLocation) ? $referrerLocation->id : $content->contentInfo->mainLocationId; + $redirectUrl = $form['redirectUrlAfterPublish']->getData() ?: $this->router->generate( '_ez_content_view', [ 'contentId' => $content->id, - 'locationId' => !empty($referrerLocation) - ? $referrerLocation->id - : $content->contentInfo->mainLocationId, + 'locationId' => $locationId, ] );