|
@@ -7538,9 +7538,12 @@ abstract class CommonObject
|
|
|
if ($field == 'entity' && is_null($this->{$field})) $queryarray[$field] = $conf->entity;
|
|
|
else {
|
|
|
// $this->{$field} may be null, '', 0, '0', 123, '123'
|
|
|
- if ($this->{$field} != '' || !empty($info['notnull'])) {
|
|
|
- if ($this->isInt($info)) $queryarray[$field] = (int) $this->{$field}; // If '0', it may be set to null later if $info['notnull'] == -1
|
|
|
- if ($this->isFloat($info)) $queryarray[$field] = (double) $this->{$field}; // If '0', it may be set to null later if $info['notnull'] == -1
|
|
|
+ if ((isset($this->{$field}) && $this->{$field} != '') || !empty($info['notnull'])) {
|
|
|
+ if ($this->isInt($info)) {
|
|
|
+ $queryarray[$field] = (int) $this->{$field}; // If '0', it may be set to null later if $info['notnull'] == -1
|
|
|
+ } elseif ($this->isFloat($info)) {
|
|
|
+ $queryarray[$field] = (double) $this->{$field}; // If '0', it may be set to null later if $info['notnull'] == -1
|
|
|
+ }
|
|
|
} else $queryarray[$field] = null;
|
|
|
}
|
|
|
} else {
|