From 087af4f300c417b9f6b1777b8f606fef4d3439d8 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Wed, 22 Feb 2023 12:26:56 +0100 Subject: [PATCH] FIX: banner: status was not displayed if status field is not called 'status' + error if getLibStatut method not implemented --- htdocs/core/lib/functions.lib.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 35436f9d2be..d503026a868 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2308,14 +2308,12 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi } $tmptxt = $object->getLibStatut(5); $morehtmlstatus .= $tmptxt; // No status on task - } else { // Generic case - if (isset($object->status)) { - $tmptxt = $object->getLibStatut(6); - if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) { - $tmptxt = $object->getLibStatut(5); - } - $morehtmlstatus .= $tmptxt; + } elseif (method_exists($object, 'getLibStatut')) { // Generic case + $tmptxt = $object->getLibStatut(6); + if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) { + $tmptxt = $object->getLibStatut(5); } + $morehtmlstatus .= $tmptxt; } // Add if object was dispatched "into accountancy"