From 8068d07c83620ab4bacc17a49ff2033db526c30a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Tue, 12 Mar 2024 21:21:29 +0100 Subject: [PATCH] fix warning --- htdocs/holiday/card.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 48b96e4dd39..895d96d6966 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -1290,8 +1290,12 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { print ''.$langs->trans("Type").''; print ''; $typeleaves = $object->getTypes(1, -1); - $labeltoshow = (($typeleaves[$object->fk_type]['code'] && $langs->trans($typeleaves[$object->fk_type]['code']) != $typeleaves[$object->fk_type]['code']) ? $langs->trans($typeleaves[$object->fk_type]['code']) : $typeleaves[$object->fk_type]['label']); - print empty($labeltoshow) ? $langs->trans("TypeWasDisabledOrRemoved", $object->fk_type) : $labeltoshow; + if (empty($typeleaves[$object->fk_type])) { + $labeltoshow = $langs->trans("TypeWasDisabledOrRemoved", $object->fk_type); + } else { + $labeltoshow = (($typeleaves[$object->fk_type]['code'] && $langs->trans($typeleaves[$object->fk_type]['code']) != $typeleaves[$object->fk_type]['code']) ? $langs->trans($typeleaves[$object->fk_type]['code']) : $typeleaves[$object->fk_type]['label']); + } + print $labeltoshow; print ''; print '';