From 6ddee8861523a67e33bc3247eae7e2d12db4d4b7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 1 Aug 2023 13:55:33 +0200 Subject: [PATCH] FIX Duplicate warning message --- htdocs/holiday/define_holiday.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 0e7818f6168..70692286b0a 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -164,8 +164,6 @@ if (empty($reshook)) { if ($result < 0) { setEventMessages($holiday->error, $holiday->errors, 'errors'); $error++; - } elseif ($result == 0) { - setEventMessages($langs->trans("HolidayQtyNotModified", $user->login), null, 'warnings'); } // Update of the days of the employee @@ -191,6 +189,10 @@ if (empty($reshook)) { } } + if (!$error && !$nbok) { + setEventMessages($langs->trans("HolidayQtyNotModified", $user->login), null, 'warnings'); + } + if (!$error) { $db->commit();