mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
#FIX: #22509 default value on integer fields don't retrieve by setSaveQuery
This commit is contained in:
@@ -8829,7 +8829,11 @@ abstract class CommonObject
|
||||
// $this->{$field} may be null, '', 0, '0', 123, '123'
|
||||
if ((isset($this->{$field}) && $this->{$field} != '') || !empty($info['notnull'])) {
|
||||
if (!isset($this->{$field})) {
|
||||
$queryarray[$field] = 0;
|
||||
if (!empty($info['default'])) {
|
||||
$queryarray[$field] = $info['default'];
|
||||
} else {
|
||||
$queryarray[$field] = 0;
|
||||
}
|
||||
} else {
|
||||
$queryarray[$field] = (int) $this->{$field}; // If '0', it may be set to null later if $info['notnull'] == -1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user