From 4eaf7288ba687af2a18f37273bb17f3b11539efa Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Wed, 18 Sep 2013 12:10:56 +0200 Subject: [PATCH] create helper for retrieving passed url view --- core/lib/Thelia/Model/ConfigQuery.php | 8 +++++++- core/lib/Thelia/Model/Product.php | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/core/lib/Thelia/Model/ConfigQuery.php b/core/lib/Thelia/Model/ConfigQuery.php index 7df592fd2..7f65b103d 100755 --- a/core/lib/Thelia/Model/ConfigQuery.php +++ b/core/lib/Thelia/Model/ConfigQuery.php @@ -56,9 +56,15 @@ class ConfigQuery extends BaseConfigQuery { public static function getPageNotFoundView() { - return self::read("page_not_found_view", '404.html'); + return self::read("page_not_found_view", '404'); } + public static function getPassedUrlView() + { + return self::read('passed_url_view', 'passed-url'); + } + + public static function getActiveTemplate() { return self::read('active-template', 'default'); diff --git a/core/lib/Thelia/Model/Product.php b/core/lib/Thelia/Model/Product.php index 9f7f9155f..cbb6c0051 100755 --- a/core/lib/Thelia/Model/Product.php +++ b/core/lib/Thelia/Model/Product.php @@ -204,7 +204,7 @@ class Product extends BaseProduct ->filterByView($this->getRewrittenUrlViewName()) ->filterByViewId($this->getId()) ->update(array( - "View" => ConfigQuery::read('passed_url_view', 'passed-url') + "View" => ConfigQuery::getPassedUrlView() )); $this->dispatchEvent(TheliaEvents::AFTER_DELETEPRODUCT, new ProductEvent($this)); }