From 6d00b6c5476429fe4667b462364c747bb01332af Mon Sep 17 00:00:00 2001 From: afornerot Date: Tue, 27 Oct 2020 08:59:20 +0100 Subject: [PATCH] erreur sur filtre par categorie d'items --- .../Cadoles/PortalBundle/Controller/PagewidgetController.php | 1 - .../src/Cadoles/PortalBundle/Repository/ItemRepository.php | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php index 108cf3bf..6dbee6f9 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php @@ -581,7 +581,6 @@ class PagewidgetController extends Controller case "itemcategory": $iditemcategory=$parameter["value"]; - if($iditemcategory) $itemcategoryfilter=$this->em->getRepository("CadolesPortalBundle:Itemcategory")->findBy(["id"=>$iditemcategory]); break; case "search": diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Repository/ItemRepository.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Repository/ItemRepository.php index b7e00946..c4173788 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Repository/ItemRepository.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Repository/ItemRepository.php @@ -18,7 +18,10 @@ class ItemRepository extends EntityRepository if($user) $bookmarks=$this->getEntityManager()->getRepository("CadolesPortalBundle:Bookmark")->findBy(["user"=>$user]); - + + $itemcategoryfilter=null; + if($iditemcategory) $itemcategoryfilter=$this->getEntityManager()->getRepository("CadolesPortalBundle:Itemcategory")->findBy(["id"=>$iditemcategory]); + // Bookmark lié à un item $bookmarksitems=new ArrayCollection(); if($withbookmark==0) {