From 6e1d6ab795e17cd9e7e140c83a4baecb5295fe9a Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 3 Jan 2021 12:00:25 +0100 Subject: [PATCH] Changed point in which specs are applied for tags list --- module/Core/src/Repository/TagRepository.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/module/Core/src/Repository/TagRepository.php b/module/Core/src/Repository/TagRepository.php index 3b3c5beb..71d291ef 100644 --- a/module/Core/src/Repository/TagRepository.php +++ b/module/Core/src/Repository/TagRepository.php @@ -31,13 +31,17 @@ class TagRepository extends EntitySpecificationRepository implements TagReposito */ public function findTagsWithInfo(?Specification $spec = null): array { - $qb = $this->getQueryBuilder($spec, 't'); + $qb = $this->createQueryBuilder('t'); $qb->select('t AS tag', 'COUNT(DISTINCT s.id) AS shortUrlsCount', 'COUNT(DISTINCT v.id) AS visitsCount') ->leftJoin('t.shortUrls', 's') ->leftJoin('s.visits', 'v') ->groupBy('t') ->orderBy('t.name', 'ASC'); + if ($spec !== null) { + $this->applySpecification($qb, $spec, 't'); + } + $query = $qb->getQuery(); return map(