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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Jun 8 02:51:11 PDT 2016


Author: verenadiewald
Date: 2016-06-08 02:51:11 -0700 (Wed, 08 Jun 2016)
New Revision: 9511

Modified:
   trunk/mapbender/http/classes/class_wms.php
Log:
change in function updateObjInDB: start counter for child layer name compare at 1 of objLayer instead of 0 (root-layer ist handled in a separate section)

Modified: trunk/mapbender/http/classes/class_wms.php
===================================================================
--- trunk/mapbender/http/classes/class_wms.php	2016-06-07 14:56:31 UTC (rev 9510)
+++ trunk/mapbender/http/classes/class_wms.php	2016-06-08 09:51:11 UTC (rev 9511)
@@ -2871,8 +2871,8 @@
 		$t = array('i');
 		$c = 2;
 		$sql = "SELECT layer_id, layer_name, layer_title, layer_abstract, inspire_download FROM layer WHERE fkey_wms_id = $1 AND layer_pos > 0 AND NOT layer_name IN(";
-		for($i=0; $i<count($this->objLayer); $i++){
-			if($i>0){$sql .= ',';}
+		for($i=1; $i<count($this->objLayer); $i++){
+			if($i>1){$sql .= ',';}
 			$sql .= "$".$c;
 			array_push($v,$this->objLayer[$i]->layer_name);
 			array_push($t,'s');
@@ -2899,8 +2899,8 @@
 				$c = 2;
 		$sql = "DELETE FROM ows_relation_metadata WHERE fkey_layer_id IN " ;
 		$sql .= "(SELECT layer_id FROM layer WHERE fkey_wms_id = $1 AND layer_pos > 0 AND NOT layer_name IN (";
-		for($i=0; $i<count($this->objLayer); $i++){
-				if($i>0){$sql .= ',';}
+		for($i=1; $i<count($this->objLayer); $i++){
+				if($i>1){$sql .= ',';}
 				$sql .= "$".$c;
 				array_push($v,$this->objLayer[$i]->layer_name);
 				array_push($t,'s');
@@ -2918,8 +2918,8 @@
 		$t = array('i');
 		$c = 2;
 		$sql = "DELETE FROM layer WHERE fkey_wms_id = $1 AND layer_pos > 0 AND NOT layer_name IN(";
-		for($i=0; $i<count($this->objLayer); $i++){
-			if($i>0){$sql .= ',';}
+		for($i=1; $i<count($this->objLayer); $i++){
+			if($i>1){$sql .= ',';}
 			$sql .= "$".$c;
 			array_push($v,$this->objLayer[$i]->layer_name);
 			array_push($t,'s');



More information about the Mapbender_commits mailing list