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

DataSource fix fetch field default value

Piotr Labudda пре 11 година
родитељ
комит
96414f4909
1 измењених фајлова са 3 додато и 6 уклоњено
  1. 3 6
      SE/se-lib/Data_Source.php

+ 3 - 6
SE/se-lib/Data_Source.php

@@ -75,12 +75,9 @@ class Data_Source {
 	}
 
 	public function getColDefault($fieldName) {
-		if (array_key_exists($fieldName, $this->_types)) {
-			if (!empty($this->_types[$fieldName]['default'])) {
-				return $this->_types[$fieldName]['default'];
-			}
-		}
-		return '';
+		$fldType = V::get($fieldName, '', $this->_types);
+		if (!$fldType) return '';
+		return V::get('default', '', $fldType);
 	}
 
 	function setVirtualCols($cols) {