From fb2ea549b98ef5e5d8594afcfbd09b6b42ef4e55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 29 Aug 2018 23:50:36 +0200 Subject: [PATCH] fix error when querying with type --- Repository/SingleTaskRepository.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Repository/SingleTaskRepository.php b/Repository/SingleTaskRepository.php index 6d4048371..92e04f1a8 100644 --- a/Repository/SingleTaskRepository.php +++ b/Repository/SingleTaskRepository.php @@ -128,9 +128,11 @@ class SingleTaskRepository extends \Doctrine\ORM\EntityRepository $qb->setParameter('scope', $params['scope']); } - if (\array_key_exists('types', $params)) { - $qb->andWhere($qb->expr()->in('st.type', ':types')); - $qb->setParameter('types', $params['types']); + if (\array_key_exists('types', $params) && $params['types'] !== NULL) { + if (count($params['types']) > 0) { + $qb->andWhere($qb->expr()->in('st.type', ':types')); + $qb->setParameter('types', $params['types']); + } } if (\array_key_exists('date_status', $params) and !empty($params['date_status'])) {