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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Sep 22 01:45:49 PDT 2016


Author: armin11
Date: 2016-09-22 01:45:48 -0700 (Thu, 22 Sep 2016)
New Revision: 9600

Modified:
   trunk/mapbender/http/classes/class_wmc.php
Log:
Bugfix for wmc with integrated owsproxy services

Modified: trunk/mapbender/http/classes/class_wmc.php
===================================================================
--- trunk/mapbender/http/classes/class_wmc.php	2016-09-20 08:32:43 UTC (rev 9599)
+++ trunk/mapbender/http/classes/class_wmc.php	2016-09-22 08:45:48 UTC (rev 9600)
@@ -615,10 +615,10 @@
 		//$sql .= ") AND (name = 'time' or name = 'elevation')";
 		//following attributes should be exchanged for time:
 		$attributeNames = array('unitSymbol', 'default', 'multipleValues', 'nearestValue', 'current', 'extent');
-		$resStyle = db_prep_query($sql,$v,$t);
+		$resAttributes = db_prep_query($sql,$v,$t);
 		//get result as array
 		$dimension = array();
-		while($row = db_fetch_array($resStyle)) {
+		while($row = db_fetch_array($resAttributes)) {
 			foreach ($attributeNames as $attributeName) {
 				$dimension[$row["fkey_layer_id"]][$row["name"]] [$attributeName] = $row[strtolower($attributeName)];
 				//$e = new mb_exception($row["fkey_layer_id"] . " : " . $row["name"]. " - attributeName: ".$attributeName." - value from db: ".$row[strtolower($attributeName)]);	
@@ -744,6 +744,7 @@
 				}
 				//Help for problem with xlink:href attributes: http://php.net/manual/de/class.simplexmlelement.php!!!!!
 				//exchange legend urls
+				$layerDoc = simplexml_load_string($layer->saveXML());
 				if (isset($row["wms_owsproxy"]) && $row["wms_owsproxy"] != '' && !is_null($row["wms_owsproxy"])) {
 					if($layer->StyleList->Style->LegendURL->OnlineResource){
 						$arURL = parse_url($layer->StyleList->Style->LegendURL->OnlineResource->attributes('xlink', true)->href);
@@ -752,7 +753,6 @@
 						$layer->StyleList->Style->LegendURL->OnlineResource->attributes('xlink', true)->href = $url;
 					}
 				} else {
-					$layerDoc = simplexml_load_string($layer->saveXML());
 					foreach($layerDoc->xpath('/Layer/StyleList/Style[@current="1"]') as $styleObject) {
 						//only one current style is possible!
 						//if old legendurl was given, exchange it with new from database



More information about the Mapbender_commits mailing list