manage empty id

do not match current criteria if not define
This commit is contained in:
Etienne Roudeix
2013-06-21 10:37:39 +02:00
parent ad47ab7cac
commit 8e787c588c

View File

@@ -28,6 +28,7 @@ namespace Thelia\Core\Template\Loop;
use Thelia\Core\Template\Element\BaseLoop; use Thelia\Core\Template\Element\BaseLoop;
use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResult;
use Thelia\Core\Template\Element\LoopResultRow; use Thelia\Core\Template\Element\LoopResultRow;
use Thelia\Log\Tlog;
use Thelia\Model\CategoryQuery; use Thelia\Model\CategoryQuery;
/** /**
@@ -101,7 +102,7 @@ class Category extends BaseLoop {
$search = CategoryQuery::create(); $search = CategoryQuery::create();
if (!is_null($this->id)) { if (!is_null($this->id)) {
$search->filterById($this->id, \Criteria::IN); $search->filterById(explode(',', $this->id), \Criteria::IN);
} }
if(!is_null($this->parent)) { if(!is_null($this->parent)) {
@@ -110,7 +111,7 @@ class Category extends BaseLoop {
if($this->current == 1) { if($this->current == 1) {
$search->filterById($this->request->get("category_id")); $search->filterById($this->request->get("category_id"));
} else if ($this->current == 0) { } else if (null !== $this->current && $this->current == 0) {
$search->filterById($this->request->get("category_id"), \Criteria::NOT_IN); $search->filterById($this->request->get("category_id"), \Criteria::NOT_IN);
} }