From 86e727c2fbfea7ef25c9cc0ab89ffdfc4c00ce0a Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Fri, 13 Sep 2013 16:32:24 +0200 Subject: [PATCH] force_return is a global loop parameter and default value is false --- .../lib/Thelia/Core/HttpFoundation/Session/Session.php | 10 ++++++---- core/lib/Thelia/Core/Template/Element/BaseI18nLoop.php | 2 +- core/lib/Thelia/Core/Template/Element/BaseLoop.php | 1 + templates/default/index.html | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/core/lib/Thelia/Core/HttpFoundation/Session/Session.php b/core/lib/Thelia/Core/HttpFoundation/Session/Session.php index f2eaadc4d..00fb7974b 100755 --- a/core/lib/Thelia/Core/HttpFoundation/Session/Session.php +++ b/core/lib/Thelia/Core/HttpFoundation/Session/Session.php @@ -164,10 +164,12 @@ class Session extends BaseSession $cart = null; if ($cart_id) { $cart = CartQuery::create()->findPk($cart_id); - try { - $this->verifyValidCart($cart); - } catch (InvalidCartException $e) { - $cart = null; + if($cart) { + try { + $this->verifyValidCart($cart); + } catch (InvalidCartException $e) { + $cart = null; + } } } diff --git a/core/lib/Thelia/Core/Template/Element/BaseI18nLoop.php b/core/lib/Thelia/Core/Template/Element/BaseI18nLoop.php index 35077f5c4..283aad797 100644 --- a/core/lib/Thelia/Core/Template/Element/BaseI18nLoop.php +++ b/core/lib/Thelia/Core/Template/Element/BaseI18nLoop.php @@ -73,7 +73,7 @@ abstract class BaseI18nLoop extends BaseLoop $columns, $foreignTable, $foreignKey, - $forceReturn + $this->getForce_return() ); } } diff --git a/core/lib/Thelia/Core/Template/Element/BaseLoop.php b/core/lib/Thelia/Core/Template/Element/BaseLoop.php index b684d06e2..5ac23142d 100755 --- a/core/lib/Thelia/Core/Template/Element/BaseLoop.php +++ b/core/lib/Thelia/Core/Template/Element/BaseLoop.php @@ -89,6 +89,7 @@ abstract class BaseLoop Argument::createIntTypeArgument('page'), Argument::createIntTypeArgument('limit', PHP_INT_MAX), Argument::createBooleanTypeArgument('backend_context', false), + Argument::createBooleanTypeArgument('force_return', false), ); } diff --git a/templates/default/index.html b/templates/default/index.html index 39205497c..6feaf9b81 100644 --- a/templates/default/index.html +++ b/templates/default/index.html @@ -40,7 +40,7 @@