From c37377626eb83e07653f0c122ce7c038477efcc1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Dec 2021 19:43:23 +0100 Subject: [PATCH] Revert change --- htdocs/core/class/commonobject.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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])) {