[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mapbender-commits
Subject:    [Mapbender-commits] r10018 - trunk/mapbender/http/classes
From:       svn_mapbender () osgeo ! org
Date:       2018-12-17 13:22:00
Message-ID: 20181217132200.A6DC83900A3 () trac ! osgeo ! org
[Download RAW message or body]

Author: armin11
Date: 2018-12-17 05:22:00 -0800 (Mon, 17 Dec 2018)
New Revision: 10018

Modified:
   trunk/mapbender/http/classes/class_metadata.php
Log:
Fix resultlist for wfs in json format - reindex array before returning json

Modified: trunk/mapbender/http/classes/class_metadata.php
===================================================================
--- trunk/mapbender/http/classes/class_metadata.php	2018-12-14 13:35:41 UTC (rev 10017)
+++ trunk/mapbender/http/classes/class_metadata.php	2018-12-17 13:22:00 UTC (rev 10018)
@@ -406,7 +406,6 @@
 					),
 				'srv' => array()
 				);
-			
 		//read out records
 		$serverCount = 0;
 		$wfsMatrix = db_fetch_all($res);
@@ -493,9 +492,7 @@
 				#}
 				//check if module is given
 				if (isset($wfsMatrix[$i]['wfs_conf_id']) && $wfsMatrix[$i]['wfs_conf_id'] != "") {
-				
 					//if modul hasn't been created - do it
-				
 					if (!isset($this->wfsJSON->wfs->srv[$i-$j]->ftype[$l-$m]->modul)) {	
 						$this->wfsJSON->wfs->srv[$i-$j]->ftype[$l-$m]->modul = array();
 					}
@@ -519,22 +516,19 @@
 				if ($wfsMatrix[$i]['wfs_id'] == $wfsMatrix[$i+1]['wfs_id']){
 					$j++; //next record is the same service
 					$l++;	
-				}
-				else
-				{
+				} else {
 					$l = 0;
 				}
-
 				if ($wfsMatrix[$i]['featuretype_id'] == $wfsMatrix[$i+1]['featuretype_id']){
 					$m++;
-				}
-				else
-				{
+				} else {
 					$m = 0;
-				}		
-			}
-			
+				}	
+				//alter ftype to array - not associative array - built new sequence
+				$this->wfsJSON->wfs->srv[$i-$j]->ftype = array_values($this->wfsJSON->wfs->srv[$i-$j]->ftype);
+			}	
 	}
+
 	private function generateWMCMetadataJSON($res, $n) {
 		//initialize object
 		$this->wmcJSON = new stdClass;

_______________________________________________
Mapbender_commits mailing list
Mapbender_commits@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapbender_commits
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic