diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f4dcf711b65..f2471d122af 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -8528,7 +8528,9 @@ abstract class CommonObject } } } else { - $queryarray[$field] = !empty($this->{$field}) ? $this->{$field} : 0; + // Note: If $this->{$field} is not defined, it means there is a bug into definition of ->fields or a missing declaration of property + // We should keep the warning generated by this because it is a bug somewhere else in code, not here. + $queryarray[$field] = $this->{$field}; } if ($info['type'] == 'timestamp' && empty($queryarray[$field])) {