From faa86e06ba3032fdb98f3c0f79c72e8581d3c96f Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sun, 25 Sep 2016 11:21:13 +0200 Subject: Fix tags count in menu Move enable cache for Tag in the Entity because function `find*` should return result and not a Query --- .../CoreBundle/Controller/TagController.php | 28 ++++++++-------------- 1 file changed, 10 insertions(+), 18 deletions(-) (limited to 'src/Wallabag/CoreBundle/Controller') diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index bc95a4d3..07cd3edb 100644 --- a/src/Wallabag/CoreBundle/Controller/TagController.php +++ b/src/Wallabag/CoreBundle/Controller/TagController.php @@ -84,16 +84,11 @@ class TagController extends Controller { $tags = $this->getDoctrine() ->getRepository('WallabagCoreBundle:Tag') - ->findAllTags($this->getUser()->getId()) - ->getQuery() - ->getResult(); - - return $this->render( - 'WallabagCoreBundle:Tag:tags.html.twig', - [ - 'tags' => $tags, - ] - ); + ->findAllTagsWithEntries($this->getUser()->getId()); + + return $this->render('WallabagCoreBundle:Tag:tags.html.twig', [ + 'tags' => $tags, + ]); } /** @@ -127,13 +122,10 @@ class TagController extends Controller } } - return $this->render( - 'WallabagCoreBundle:Entry:entries.html.twig', - [ - 'form' => null, - 'entries' => $entries, - 'currentPage' => $page, - ] - ); + return $this->render('WallabagCoreBundle:Entry:entries.html.twig',[ + 'form' => null, + 'entries' => $entries, + 'currentPage' => $page, + ]); } } -- cgit v1.2.3 From 82fc3290d4fec45ede270e2c1ad2079fe3020adc Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sun, 25 Sep 2016 12:03:12 +0200 Subject: CS --- src/Wallabag/CoreBundle/Controller/TagController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Wallabag/CoreBundle/Controller') diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index 07cd3edb..623a6146 100644 --- a/src/Wallabag/CoreBundle/Controller/TagController.php +++ b/src/Wallabag/CoreBundle/Controller/TagController.php @@ -122,7 +122,7 @@ class TagController extends Controller } } - return $this->render('WallabagCoreBundle:Entry:entries.html.twig',[ + return $this->render('WallabagCoreBundle:Entry:entries.html.twig', [ 'form' => null, 'entries' => $entries, 'currentPage' => $page, -- cgit v1.2.3