Bläddra i källkod

TableAjax Fix bug on saving empty integer field

Piotr Labudda 11 år sedan
förälder
incheckning
501d99f232
1 ändrade filer med 7 tillägg och 0 borttagningar
  1. 7 0
      SE/se-lib/TableAcl.php

+ 7 - 0
SE/se-lib/TableAcl.php

@@ -860,6 +860,13 @@ class TableAcl {
 				$value = $type['default'];
 			}
 
+			if (substr($type['type'], 0, 3) == 'int'
+					|| substr($type['type'], 0, 7) == 'tinyint'
+					|| substr($type['type'], 0, 8) == 'smallint'
+			) {
+				$value = intval($type['default']);
+			}
+
 			// fix bug when field is unique and is null allowed: change empty string to null
 			if ($type['null']) {
 				$value = 'NULL';