[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
--- 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; }