diff --git a/core/lib/Thelia/Model/Category.php b/core/lib/Thelia/Model/Category.php index 067c54fc1..0cade8216 100755 --- a/core/lib/Thelia/Model/Category.php +++ b/core/lib/Thelia/Model/Category.php @@ -115,6 +115,13 @@ class Category extends BaseCategory */ public function postDelete(ConnectionInterface $con = null) { + RewritingUrlQuery::create() + ->filterByView($this->getRewrittenUrlViewName()) + ->filterByViewId($this->getId()) + ->update(array( + "View" => ConfigQuery::getObsoleteRewrittenUrlView() + )); + $this->dispatchEvent(TheliaEvents::AFTER_DELETECATEGORY, new CategoryEvent($this)); } } \ No newline at end of file diff --git a/core/lib/Thelia/Model/Content.php b/core/lib/Thelia/Model/Content.php index 6417c8b56..1c1c8c0f6 100755 --- a/core/lib/Thelia/Model/Content.php +++ b/core/lib/Thelia/Model/Content.php @@ -148,6 +148,13 @@ class Content extends BaseContent public function postDelete(ConnectionInterface $con = null) { + RewritingUrlQuery::create() + ->filterByView($this->getRewrittenUrlViewName()) + ->filterByViewId($this->getId()) + ->update(array( + "View" => ConfigQuery::getObsoleteRewrittenUrlView() + )); + $this->dispatchEvent(TheliaEvents::AFTER_DELETECONTENT, new ContentEvent($this)); } } diff --git a/core/lib/Thelia/Model/Folder.php b/core/lib/Thelia/Model/Folder.php index 4b32e7591..0b9edafd6 100755 --- a/core/lib/Thelia/Model/Folder.php +++ b/core/lib/Thelia/Model/Folder.php @@ -100,6 +100,13 @@ class Folder extends BaseFolder public function postDelete(ConnectionInterface $con = null) { + RewritingUrlQuery::create() + ->filterByView($this->getRewrittenUrlViewName()) + ->filterByViewId($this->getId()) + ->update(array( + "View" => ConfigQuery::getObsoleteRewrittenUrlView() + )); + $this->dispatchEvent(TheliaEvents::AFTER_DELETEFOLDER, new FolderEvent($this)); } } diff --git a/core/lib/Thelia/Model/Product.php b/core/lib/Thelia/Model/Product.php index 3855c46c1..1f5358cbb 100755 --- a/core/lib/Thelia/Model/Product.php +++ b/core/lib/Thelia/Model/Product.php @@ -269,6 +269,7 @@ class Product extends BaseProduct ->update(array( "View" => ConfigQuery::getObsoleteRewrittenUrlView() )); + $this->dispatchEvent(TheliaEvents::AFTER_DELETEPRODUCT, new ProductEvent($this)); } }