Skip to content
Snippets Groups Projects
Commit f6dbddef authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

Anomalie #23524 : Bug de recherche sur les types d'organisation quand l'option...

Anomalie #23524 : Bug de recherche sur les types d'organisation quand l'option 'Tous' est selectionnée
parent fc0ece53
No related branches found
No related tags found
No related merge requests found
...@@ -224,15 +224,30 @@ class OrganizationService implements ServiceLocatorAwareInterface, EntityManager ...@@ -224,15 +224,30 @@ class OrganizationService implements ServiceLocatorAwareInterface, EntityManager
} }
// -------------------------------------------------------------------------------------------------------------
// FILTRE sur les types d'organisations
if (isset($filter['type']) && $filter['type']){ if (isset($filter['type']) && $filter['type']){
// On purge les types vides (option "Tous")
$cleanTypes = [];
foreach ($filter['type'] as $typeValue) {
if( $typeValue ){
$cleanTypes[] = $typeValue;
}
}
if( count($cleanTypes) > 0 ){
$types = $this->getEntityManager()->getRepository(OrganizationType::class)->createQueryBuilder('t') $types = $this->getEntityManager()->getRepository(OrganizationType::class)->createQueryBuilder('t')
->where('t.id IN (:types)') ->where('t.id IN (:types)')
->setParameter('types', $filter['type']) ->setParameter('types', $cleanTypes)
->getQuery() ->getQuery()
->getResult(); ->getResult();
$qb->leftJoin('o.typeObj', 't') $qb->leftJoin('o.typeObj', 't')
->andWhere('t.id IN(:type)')->setParameter('type', $types); ->andWhere('t.id IN(:type)')
->setParameter('type', $types);
}
} }
if (isset($filter['active']) && $filter['active']){ if (isset($filter['active']) && $filter['active']){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment