From e73ca1d7496eedeccc8a96c2c8b12d5fd8d26b33 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Sep 2025 23:17:26 +0200 Subject: [PATCH] Better error management --- htdocs/core/class/html.formfile.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 2c854f44b74..13423336cff 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -2068,7 +2068,10 @@ class FormFile if ($id) { $result = $object_instance->fetch($id); } else { - if (!($result = $object_instance->fetch(0, $ref))) { + $result = $object_instance->fetch(0, $ref); + if ($result < 0) { + print $object_instance->error; + } elseif ($result == 0) { // fetchOneLike looks for objects with wildcards in its reference. // It is useful for those masks who get underscores instead of their actual symbols (because the _ had replaced all forbidden chars into filename) // TODO Example when this is needed ?