Преглед изворни кода

fixed the_geom type geometry

Piotr Labudda пре 9 година
родитељ
комит
16a9a64da1
1 измењених фајлова са 14 додато и 3 уклоњено
  1. 14 3
      SE/se-lib/TableAcl.php

+ 14 - 3
SE/se-lib/TableAcl.php

@@ -986,10 +986,21 @@ class TableAcl extends Core_AclBase {
 			//             [null] => 1
 			//             [default] =>
 			//             [simpleType] => linestring
-			if ('geometry' == $field['type'] && !empty($field['simpleType'])) {
-				switch ($field['simpleType']) {
-					case 'gml:LineStringPropertyType': $this->_types[ $fieldName ][ 'type' ] = 'linestring'; break;
+			if ('geometry' == $field['type']) {
+				if (!empty($field['simpleType'])) {
+					switch ($field['simpleType']) {
+						case 'gml:LineStringPropertyType': $this->_types[ $fieldName ][ 'type' ] = 'linestring'; break;
+					}
 				}
+				$dbName = DB::getPDO()->getDatabaseName();
+				$tableName = $this->getName();
+				$geomType = DB::getPDO()->fetchValue("select DATA_TYPE
+					from `information_schema`.`COLUMNS`
+					where TABLE_SCHEMA='{$dbName}'
+						and TABLE_NAME='{$tableName}'
+						and COLUMN_NAME='{$fieldName}'
+				");
+				if (!empty($geomType)) $this->_types[ $fieldName ][ 'type' ] = $geomType;
 			}
 		}