From fb7e441f5d7c831bde1d30eb313f8480dbde268a Mon Sep 17 00:00:00 2001 From: Zoran Kabic Date: Mon, 25 Mar 2024 12:43:04 +0100 Subject: [PATCH] Use package slug only if its not empty --- .../CoreBundle/EventListener/OverrideArticleSlugListener.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SWP/Bundle/CoreBundle/EventListener/OverrideArticleSlugListener.php b/src/SWP/Bundle/CoreBundle/EventListener/OverrideArticleSlugListener.php index aa78a8570..9f40701dd 100644 --- a/src/SWP/Bundle/CoreBundle/EventListener/OverrideArticleSlugListener.php +++ b/src/SWP/Bundle/CoreBundle/EventListener/OverrideArticleSlugListener.php @@ -51,7 +51,7 @@ public function overrideSlugIfNeeded(ArticleEvent $event): void if ($overrideSlugOnCorrection && null !== $article->getSlug()) { $this->savePreviousRelativeUrl($article); - $slug = empty($package->getSlugline()) ? + $slug = !empty($package->getSlugline()) ? $package->getSlugline() : Transliterator::urlize($article->getTitle()); $article->setSlug($slug); }