diff --git a/core/lib/Thelia/Core/Template/Element/BaseLoop.php b/core/lib/Thelia/Core/Template/Element/BaseLoop.php index 2aa5e874f..215537431 100644 --- a/core/lib/Thelia/Core/Template/Element/BaseLoop.php +++ b/core/lib/Thelia/Core/Template/Element/BaseLoop.php @@ -339,7 +339,7 @@ abstract class BaseLoop public function count() { $hash = $this->args->getHash(); - if(false === array_key_exists($hash, self::$cacheCount)) + if(false === isset(self::$cacheCount[$hash])) { $count = 0; if ($this instanceof PropelSearchLoopInterface) { @@ -370,7 +370,7 @@ abstract class BaseLoop public function exec(&$pagination) { $hash = $this->args->getHash(); - if(false === array_key_exists($hash, self::$cacheLoopResult)) + if(false === isset(self::$cacheLoopResult[$hash])) { if ($this instanceof PropelSearchLoopInterface) { $searchModelCriteria = $this->buildModelCriteria(); diff --git a/core/lib/Thelia/Core/Template/Loop/Argument/Argument.php b/core/lib/Thelia/Core/Template/Loop/Argument/Argument.php index 0ba86e7d0..56100e490 100644 --- a/core/lib/Thelia/Core/Template/Loop/Argument/Argument.php +++ b/core/lib/Thelia/Core/Template/Loop/Argument/Argument.php @@ -56,6 +56,11 @@ class Argument return $this->type->getFormattedValue($this->value); } + public function getRawValue() + { + return $this->value; + } + public function setValue($value) { if ($value === null) { @@ -147,4 +152,5 @@ class Argument $empty ); } + } diff --git a/core/lib/Thelia/Core/Template/Loop/Argument/ArgumentCollection.php b/core/lib/Thelia/Core/Template/Loop/Argument/ArgumentCollection.php index 7f5a604c5..eb815c708 100644 --- a/core/lib/Thelia/Core/Template/Loop/Argument/ArgumentCollection.php +++ b/core/lib/Thelia/Core/Template/Loop/Argument/ArgumentCollection.php @@ -153,6 +153,11 @@ class ArgumentCollection implements \Iterator unset($arguments['name']); } - return sha1(serialize($arguments)); + $string = ''; + foreach ($arguments as $key => $argument) { + $string .= $key.'='.$argument->getRawValue(); + } + + return md5($string); } }