Fixed depracation of rewritten URL
This commit is contained in:
@@ -225,8 +225,9 @@ trait UrlRewritingTrait {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* deprecate the old one if needed */
|
/* deprecate the old one if needed */
|
||||||
$oldRewritingUrl = RewritingUrlQuery::create()->findOneByUrl($currentUrl);
|
if (null !== $oldRewritingUrl = RewritingUrlQuery::create()->findOneByUrl($currentUrl)) {
|
||||||
$oldRewritingUrl->setRedirected($rewritingUrl->getId())->save();
|
$oldRewritingUrl->setRedirected($rewritingUrl->getId())->save();
|
||||||
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user