From a7decb217300cee89b1469e36d58fc91c6462c49 Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Fri, 13 Apr 2018 02:42:19 +0200 Subject: [PATCH 1/2] printTopRightMenu trigger numeric never empty maybe find something better --- htdocs/main.inc.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 359a7ea27a1..7a097893b39 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1493,10 +1493,13 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $result=$hookmanager->executeHooks('printTopRightMenu',$parameters); // Note that $action and $object may have been modified by some hooks if (is_numeric($result)) { - if (empty($result)) $toprightmenu.=$hookmanager->resPrint; // add - else $toprightmenu=$hookmanager->resPrint; // replace + if ($result== 0) + $toprightmenu.=$hookmanager->resPrint; // add + else + $toprightmenu=$hookmanager->resPrint; // replace } - else $toprightmenu.=$result; // For backward compatibility + else + $toprightmenu.=$result; // For backward compatibility // Link to module builder if (! empty($conf->modulebuilder->enabled)) From b1043e2a5710caa2f7c3920ddc0cb6efaeca6bf4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Apr 2018 10:37:40 +0200 Subject: [PATCH 2/2] Update main.inc.php --- htdocs/main.inc.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 7a097893b39..f1d6487d5de 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1493,14 +1493,16 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $result=$hookmanager->executeHooks('printTopRightMenu',$parameters); // Note that $action and $object may have been modified by some hooks if (is_numeric($result)) { - if ($result== 0) + if ($result == 0) $toprightmenu.=$hookmanager->resPrint; // add else $toprightmenu=$hookmanager->resPrint; // replace } - else + else + { $toprightmenu.=$result; // For backward compatibility - + } + // Link to module builder if (! empty($conf->modulebuilder->enabled)) {