From 16a20693be07600e25dcf5edeb94e53699f63787 Mon Sep 17 00:00:00 2001 From: canyonknight Date: Wed, 14 Nov 2012 17:05:53 -0500 Subject: pkgfuncs.inc.php: Rework query to avoid "Required by" duplicates Packages with multiple DepConditions are returned multiple times in the "Required by" column. Limit SQL results to distinct packages. Fixes FS#32478 Signed-off-by: canyonknight Signed-off-by: Lukas Fleischer --- web/lib/pkgfuncs.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web/lib/pkgfuncs.inc.php') diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php index 8f84cdf5..cfdd9a79 100644 --- a/web/lib/pkgfuncs.inc.php +++ b/web/lib/pkgfuncs.inc.php @@ -169,7 +169,7 @@ function package_required($name="", $dbh=NULL) { if(!$dbh) { $dbh = db_connect(); } - $q = "SELECT p.Name, PackageID FROM PackageDepends pd "; + $q = "SELECT DISTINCT p.Name, PackageID FROM PackageDepends pd "; $q.= "JOIN Packages p ON pd.PackageID = p.ID "; $q.= "WHERE DepName = " . $dbh->quote($name) . " "; $q.= "ORDER BY p.Name"; -- cgit v1.2.3-24-g4f1b