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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Sep 9 02:02:04 PDT 2016


Author: armin11
Date: 2016-09-09 02:02:04 -0700 (Fri, 09 Sep 2016)
New Revision: 9589

Modified:
   trunk/mapbender/http/classes/class_wms.php
Log:
Fix for registrating wms with time dimension

Modified: trunk/mapbender/http/classes/class_wms.php
===================================================================
--- trunk/mapbender/http/classes/class_wms.php	2016-09-09 09:01:38 UTC (rev 9588)
+++ trunk/mapbender/http/classes/class_wms.php	2016-09-09 09:02:04 UTC (rev 9589)
@@ -1946,7 +1946,7 @@
 			return null;
 		}
 		db_commit();
-
+		
 		//
 		// update GeoRSS feed
 		//
@@ -2320,7 +2320,7 @@
         //for none named layer (only title is set)	
         if (empty($layerObject)){
         	$xpathLayerName="//Layer[./Title =\"".$layerName."\"]";
-            $layerObject=$wmsCapXml->xpath($xpathLayerName);
+            	$layerObject=$wmsCapXml->xpath($xpathLayerName);
         }
 
 		if(!isset($layerObject[0])) {
@@ -2479,12 +2479,15 @@
 		}
 		//do the things for the parent layers
 		//get parent layer
-		$admin = new administration();
-		$layerIdArray = $admin->getParentLayers($this->wms_id, $this->objLayer[$i]->db_id);
-		if ($layerIdArray !== false AND count($layerIdArray) > 0 AND is_array($layerIdArray)) {
-			//insert dimensions from parent layers
-			$sql = "INSERT INTO layer_dimension (fkey_layer_id, name, units, unitSymbol,\"default\", multipleValues, nearestValue, current, extent, inherited) SELECT ".$this->objLayer[$i]->db_id." AS fkey_layer_id, name, units, unitSymbol,\"default\", multipleValues, nearestValue, current, extent, true as inherited FROM layer_dimension WHERE fkey_layer_id IN (".implode(",",$layerIdArray).") AND inherited IS FALSE";
-			$res = db_query($sql);
+		$e = new mb_exception("wms_id: ".$this->wms_id);
+		if (is_int($this->wms_id)) {
+			$admin = new administration();
+			$layerIdArray = $admin->getParentLayers($this->wms_id, $this->objLayer[$i]->db_id);
+			if ($layerIdArray !== false AND count($layerIdArray) > 0 AND is_array($layerIdArray)) {
+				//insert dimensions from parent layers
+				$sql = "INSERT INTO layer_dimension (fkey_layer_id, name, units, unitSymbol,\"default\", multipleValues, nearestValue, current, extent, inherited) SELECT ".$this->objLayer[$i]->db_id." AS fkey_layer_id, name, units, unitSymbol,\"default\", multipleValues, nearestValue, current, extent, true as inherited FROM layer_dimension WHERE fkey_layer_id IN (".implode(",",$layerIdArray).") AND inherited IS FALSE";
+				$res = db_query($sql);
+			}
 		}
 	}
 	function insertLayerEPSG($i) {



More information about the Mapbender_commits mailing list