From f61e79dc5513f7cf03dc20e7c465bd9b78322670 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 May 2023 05:08:19 +0200 Subject: [PATCH] Fix missing return --- htdocs/emailcollector/class/emailcollector.class.php | 6 +++++- htdocs/fichinter/class/fichinterrec.class.php | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 682c539b784..65dec152abf 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -762,8 +762,12 @@ class EmailCollector extends CommonObject $i++; } $this->db->free($resql); + + return 1; } else { dol_print_error($this->db); + + return -1; } } @@ -3274,7 +3278,7 @@ class EmailCollector extends CommonObject * @param Object $mbox Structure * @param string $mid UID email * @param string $destdir Target dir for attachments - * @return array Array with number and object + * @return void */ private function getmsg($mbox, $mid, $destdir = '') { diff --git a/htdocs/fichinter/class/fichinterrec.class.php b/htdocs/fichinter/class/fichinterrec.class.php index 17104fb757d..a1df7940142 100644 --- a/htdocs/fichinter/class/fichinterrec.class.php +++ b/htdocs/fichinter/class/fichinterrec.class.php @@ -245,6 +245,7 @@ class FichinterRec extends Fichinter if ($error) { $this->db->rollback(); + return -1; } else { $this->db->commit(); return $this->id; @@ -478,6 +479,7 @@ class FichinterRec extends Fichinter // Check parameters if ($type < 0) { + $this->error = 'Bad value for parameter type'; return -1; } @@ -569,6 +571,9 @@ class FichinterRec extends Fichinter $this->error = $this->db->lasterror(); return -1; } + } else { + $this->error = 'Bad status of recurring intervention. Must be draft status to allow addition of lines'; + return -1; } }