Explorar o código

Fix bug on saving empty integer field

Piotr Labudda %!s(int64=11) %!d(string=hai) anos
pai
achega
a8f3617165
Modificáronse 1 ficheiros con 5 adicións e 2 borrados
  1. 5 2
      SE/se-lib/TableAjax.php

+ 5 - 2
SE/se-lib/TableAjax.php

@@ -3414,10 +3414,13 @@ jQuery(document).ready(function(){
 					// default value for perms 'W' without 'R' is '*****'
 					// default value for perms 'W' without 'R' is '*****'
 				}
 				}
 				else {
 				else {
-					$sqlObj->{$vField['name']} = $args["f{$kID}"];
+					$value = $args["f{$kID}"];
 
 
 					if (empty($args["f{$kID}"]) && strlen($args["f{$kID}"]) == 0) {// fix bug in input type date and value="0000-00-00"
 					if (empty($args["f{$kID}"]) && strlen($args["f{$kID}"]) == 0) {// fix bug in input type date and value="0000-00-00"
-						$sqlObj->{$vField['name']} = $this->_acl->fixEmptyValueFromUser($kID);
+						$value = $this->_acl->fixEmptyValueFromUser($kID);
+					}
+					if ($record->{$vField['name']} != $value) {
+						$sqlObj->{$vField['name']} = $value;
 					}
 					}
 				}
 				}
 			}
 			}