[Mapbender-commits] r7020 - trunk/mapbender/http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Oct 4 10:23:22 EDT 2010


Author: christoph
Date: 2010-10-04 14:23:22 +0000 (Mon, 04 Oct 2010)
New Revision: 7020

Modified:
   trunk/mapbender/http/classes/class_layer_monitor.php
Log:
only update if layer exists

Modified: trunk/mapbender/http/classes/class_layer_monitor.php
===================================================================
--- trunk/mapbender/http/classes/class_layer_monitor.php	2010-10-04 14:23:01 UTC (rev 7019)
+++ trunk/mapbender/http/classes/class_layer_monitor.php	2010-10-04 14:23:22 UTC (rev 7020)
@@ -34,6 +34,16 @@
 		}
 
 		//check if an entry exists for the current layer id
+		$sql = "SELECT COUNT(layer_id) AS i FROM layer WHERE layer_id = $1";
+		$v = array($layer_id);
+		$t = array('i');
+		$res = db_prep_query($sql, $v, $t);
+		$row = db_fetch_array($res);
+		if (intval($row["i"]) === 0) {
+			return false;
+		}
+
+		//check if an entry exists for the current layer id
 		$sql = "SELECT load_count FROM layer_load_count WHERE fkey_layer_id = $1";
 		$v = array($layer_id);
 		$t = array('i');



More information about the Mapbender_commits mailing list