From 66d6d03770fbd7aa1937fc6b8e69bc01ac4b7b6b Mon Sep 17 00:00:00 2001 From: Franck Allimant Date: Mon, 20 Jan 2014 23:38:14 +0100 Subject: [PATCH] Fixed depracation of rewritten URL --- core/lib/Thelia/Model/Tools/UrlRewritingTrait.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/lib/Thelia/Model/Tools/UrlRewritingTrait.php b/core/lib/Thelia/Model/Tools/UrlRewritingTrait.php index d8e699322..fbe64378c 100644 --- a/core/lib/Thelia/Model/Tools/UrlRewritingTrait.php +++ b/core/lib/Thelia/Model/Tools/UrlRewritingTrait.php @@ -225,8 +225,9 @@ trait UrlRewritingTrait { } /* deprecate the old one if needed */ - $oldRewritingUrl = RewritingUrlQuery::create()->findOneByUrl($currentUrl); - $oldRewritingUrl->setRedirected($rewritingUrl->getId())->save(); + if (null !== $oldRewritingUrl = RewritingUrlQuery::create()->findOneByUrl($currentUrl)) { + $oldRewritingUrl->setRedirected($rewritingUrl->getId())->save(); + } return $this; }