Jelajahi Sumber

fixed wfs GetFeature bug if missing propertyName - default all fields

Piotr Labudda 8 tahun lalu
induk
melakukan
5e3ccf9088
1 mengubah file dengan 6 tambahan dan 6 penghapusan
  1. 6 6
      SE/se-lib/Api/Wfs/GetFeature.php

+ 6 - 6
SE/se-lib/Api/Wfs/GetFeature.php

@@ -156,7 +156,8 @@ class Api_Wfs_GetFeature {
 			$xmlWriter->writeAttribute($name, $value);
 			$xmlWriter->writeAttribute($name, $value);
 		}
 		}
 
 
-		$fldList = $acl->getRealFieldListByIdZasob();
+		// $fldList = $acl->getRealFieldListByIdZasob();
+		$fldList = $acl->getFieldListByIdZasob();
 		$geomFld = null;
 		$geomFld = null;
 		foreach ($fldList as $fldName) {
 		foreach ($fldList as $fldName) {
 			if ($acl->isGeomField($fldName)) {
 			if ($acl->isGeomField($fldName)) {
@@ -166,12 +167,11 @@ class Api_Wfs_GetFeature {
 
 
 		DBG::log($fldList, 'array', ">>> loop start fields(".count($fldList).")");
 		DBG::log($fldList, 'array', ">>> loop start fields(".count($fldList).")");
 		// DBG::log($showFields, 'array', "DBG: \$showLocalFields \$showFields 0");
 		// DBG::log($showFields, 'array', "DBG: \$showLocalFields \$showFields 0");
-		$showLocalFields = array_filter(
-			($showFields) ? $showFields : $fldList, // if empty filter cols show all local fields
-			function ($showFieldName) {
+		$showLocalFields = ($showFields) // if empty filter cols show all local fields
+		?	array_filter($showFields, function ($showFieldName) {
 				return (false === strpos($showFieldName, "/"));
 				return (false === strpos($showFieldName, "/"));
-			}
-		);
+			})
+		:	$fldList;
 		DBG::log($showLocalFields, 'array', "DBG: \$showLocalFields");
 		DBG::log($showLocalFields, 'array', "DBG: \$showLocalFields");
 		$fldList = array_filter($fldList, function ($fieldName) use ($showLocalFields) {
 		$fldList = array_filter($fldList, function ($fieldName) use ($showLocalFields) {
 			return (in_array($fieldName, $showLocalFields));
 			return (in_array($fieldName, $showLocalFields));