From a4785adb3df9cf7162b21814c4e4204a67ce7ad6 Mon Sep 17 00:00:00 2001 From: tnegre Date: Thu, 12 Dec 2024 15:28:19 +0100 Subject: [PATCH] FIX : display error when loan can't be deleted --- htdocs/loan/card.php | 4 ++-- htdocs/loan/class/loan.class.php | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 8c4cc3810b855..45e8fe0fd8af6 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -82,7 +82,7 @@ if ($result > 0) { setEventMessages($langs->trans('LoanPaid'), null, 'mesgs'); } else { - setEventMessages($loan->error, null, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -95,7 +95,7 @@ header("Location: list.php"); exit; } else { - setEventMessages($loan->error, null, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index 98051a0d2b6b5..0f077d0d9ed4b 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -308,6 +308,7 @@ public function delete($user) $accountline->fetch($line_url['fk_bank']); $result = $accountline->delete_urls($user); if ($result < 0) { + $this->errors = array_merge($this->errors, [$accountline->error], $accountline->errors); $error++; } }