add more test for rewriten url

This commit is contained in:
Manuel Raynaud
2013-09-18 12:03:02 +02:00
parent 6483813a35
commit e638a927c0
4 changed files with 52 additions and 22 deletions

View File

@@ -200,6 +200,12 @@ class Product extends BaseProduct
*/
public function postDelete(ConnectionInterface $con = null)
{
RewritingUrlQuery::create()
->filterByView($this->getRewrittenUrlViewName())
->filterByViewId($this->getId())
->update(array(
"View" => ConfigQuery::read('passed_url_view', 'passed-url')
));
$this->dispatchEvent(TheliaEvents::AFTER_DELETEPRODUCT, new ProductEvent($this));
}
}

View File

@@ -104,7 +104,7 @@ trait UrlRewritingTrait {
->filterByViewLocale($locale)
->filterByView($this->getRewrittenUrlViewName())
->filterByViewId($this->getId())
->filterByRedirected(0)
->filterByRedirected(null)
->findOne()
;