[feladat @ 240]
authorpeter
Mon, 07 Apr 2008 19:11:03 +0000
changeset 134 a8228f676bf7
parent 133 7863d881b8a5
child 135 3673b1c9246c
[feladat @ 240] Bugfix: when a zone has no records (eg a incorrect slave) it was not possible to delete this zone. Modified the query to fetch the records of the zone with a LEFT OUTER JOIN so there still will be a result when an empty zone is selected. This closes ticket:25. Bugfix: Made the query compatible with pgsql
inc/record.inc.php
--- a/inc/record.inc.php	Sun Apr 06 18:54:52 2008 +0000
+++ b/inc/record.inc.php	Mon Apr 07 19:11:03 2008 +0000
@@ -599,10 +599,9 @@
 					domains.name AS name, 
 					domains.master AS master_ip,
 					count(records.domain_id) AS record_count
-					FROM domains, records 
+					FROM domains LEFT OUTER JOIN records ON domains.id = records.domain_id 
 					WHERE domains.id = " . $db->quote($zone_id) . "
-					AND domains.id = records.domain_id 
-					GROUP BY domains.id";
+					GROUP BY domains.id, domains.type, domains.name, domains.master";
 		$result = $db->query($query);
 		if (PEAR::isError($result)) { error($result->getMessage()); return false; }