Fixed depracation of rewritten URL
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user