diff --git a/module/Core/src/Tag/Repository/TagRepository.php b/module/Core/src/Tag/Repository/TagRepository.php index 825a4249..740a79ae 100644 --- a/module/Core/src/Tag/Repository/TagRepository.php +++ b/module/Core/src/Tag/Repository/TagRepository.php @@ -107,8 +107,8 @@ class TagRepository extends EntitySpecificationRepository implements TagReposito ->select( 't.id_0 AS id', 't.name_1 AS name', - 'v.visits', - 'v2.non_bot_visits', + 'COALESCE(v.visits, 0) AS visits', // COALESCE required for postgres to properly order + 'COALESCE(v2.non_bot_visits, 0) AS non_bot_visits', // COALESCE required for postgres to properly order 'COUNT(DISTINCT s.id) AS short_urls_count', ) ->from('(' . $subQb->getQuery()->getSQL() . ')', 't') // @phpstan-ignore-line