From 86c6ef23e352f7d51a4833453b0c31b4dfef9a7d Mon Sep 17 00:00:00 2001 From: atm-lena Date: Tue, 1 Sep 2020 10:05:55 +0200 Subject: [PATCH] Errors management v2 --- htdocs/comm/action/class/actioncomm.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 54b0b1f634e..c91ac1a1abe 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -2084,7 +2084,10 @@ class ActionComm extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_reminder WHERE dateremind < '".$this->db->jdate($now - (3600 * 24 * 32))."'"; $resql = $this->db->query($sql); - if(!$resql) $error ++; + if(!$resql) { + $errorsMsg[] = 'Failed to delete old reminders'; + $error ++; + } } @@ -2094,7 +2097,7 @@ class ActionComm extends CommonObject } else { $this->db->rollback(); - return end($errorsMsg); + return (!empty($errorsMsg)) ? end($errorsMsg) : $error; } }