diff --git a/src/Repository/PackageRepository.php b/src/Repository/PackageRepository.php index 28baeafe..45b3a4cf 100644 --- a/src/Repository/PackageRepository.php +++ b/src/Repository/PackageRepository.php @@ -451,12 +451,11 @@ public function getSuggestCount($name) public function getSuggests($name, $offset = 0, $limit = 15) { - $sql = 'SELECT p.id, p.name, p.description, p.language, p.abandoned, p.replacementPackage + $sql = 'SELECT DISTINCT p.id, p.name, p.description, p.language, p.abandoned, p.replacementPackage FROM link_suggest s INNER JOIN package_version pv ON (pv.id = s.version_id AND pv.development = true) INNER JOIN package p ON (p.id = pv.package_id) WHERE s.packageName = :name - GROUP BY pv.package_id ORDER BY p.name ASC LIMIT ' . ((int)$limit) . ' OFFSET ' . ((int)$offset); $stmt = $this->getEntityManager()->getConnection() diff --git a/tests/Functional/Controller/BaseAclControllerTest.php b/tests/Functional/Controller/BaseAclControllerTest.php index 00763e13..997d9156 100644 --- a/tests/Functional/Controller/BaseAclControllerTest.php +++ b/tests/Functional/Controller/BaseAclControllerTest.php @@ -71,6 +71,7 @@ public static function adminUrlProvider(): array ['/'], ['/packages/okvpn/cron-bundle'], ['/packages/okvpn/cron-bundle/stats'], + ['/packages/okvpn/cron-bundle/suggesters'], ['/packages/submit'], ['/users/'], ['/users/dev'],