[Mapbender-commits] r7362 - in trunk/mapbender/http: classes plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Dec 22 06:34:03 EST 2010


Author: armin11
Date: 2010-12-22 03:34:03 -0800 (Wed, 22 Dec 2010)
New Revision: 7362

Modified:
   trunk/mapbender/http/classes/class_wms.php
   trunk/mapbender/http/plugins/mb_metadata_server.php
Log:
Bugfixes for admin_wms_metadata - saving categories, loading services into datatable

Modified: trunk/mapbender/http/classes/class_wms.php
===================================================================
--- trunk/mapbender/http/classes/class_wms.php	2010-12-22 11:28:12 UTC (rev 7361)
+++ trunk/mapbender/http/classes/class_wms.php	2010-12-22 11:34:03 UTC (rev 7362)
@@ -10,6 +10,7 @@
 require_once dirname(__FILE__) . "/class_user.php";
 require_once dirname(__FILE__) . "/class_administration.php";
 require_once dirname(__FILE__) . "/class_georss_factory.php";
+require_once dirname(__FILE__) . "/class_mb_exception.php";
 require_once dirname(__FILE__) . "/../classes/class_universal_wms_factory.php";
 
 class wms {
@@ -2001,19 +2002,20 @@
 			$v = array($this->objLayer[$i]->db_id);
 			$t = array('i');
 			$res = db_prep_query($sql,$v,$t);
-			
 			$attr = "layer_{$cat}_category_id";
 			$k = $this->objLayer[$i]->$attr;
-			
 			for ($j = 0; $j < count($k); $j++) {
-				
 				$sql = "INSERT INTO layer_{$cat}_category (fkey_layer_id, fkey_{$cat}_category_id) VALUES ($1, $2)";
 				$v = array($this->objLayer[$i]->db_id, $k[$j]);
 				$t = array('i', 'i');
-				$res = db_prep_query($sql,$v,$t);
-				if(!$res){
-					db_rollback();	
-					return;
+				if (isset($k[$j])) {
+					$res = db_prep_query($sql,$v,$t);
+					if(!$res){
+						db_rollback();	
+						return;
+					}
+				} else {
+					$e = new mb_notice("class_wms: cat: ".$attr." was not set!");				
 				}
 			}
 		}
@@ -3067,4 +3069,4 @@
 		return $errorMsg;
 	}
 }
-?>
\ No newline at end of file
+?>

Modified: trunk/mapbender/http/plugins/mb_metadata_server.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_server.php	2010-12-22 11:28:12 UTC (rev 7361)
+++ trunk/mapbender/http/plugins/mb_metadata_server.php	2010-12-22 11:34:03 UTC (rev 7362)
@@ -46,7 +46,7 @@
 		$sql = <<<SQL
 	
 SELECT wms.wms_id, wms.wms_title, wms.wms_timestamp, wms_version, m.status_comment
-FROM wms LEFT JOIN mb_monitor AS m
+FROM wms LEFT JOIN mb_wms_availability AS m
 ON wms.wms_id = m.fkey_wms_id 
 WHERE wms_id IN ($wmsList);
 
@@ -426,4 +426,4 @@
 }
 
 $ajaxResponse->send();
-?>
\ No newline at end of file
+?>



More information about the Mapbender_commits mailing list