From 2624c7154b4d284fdf8139c8caa5b90af94527e4 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 23 Feb 2012 14:32:44 +0100 Subject: [PATCH] Fix: add is_object test --- htdocs/main.inc.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index fd3b7135874..aaf62d3ae87 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1065,10 +1065,9 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a global $user, $conf, $langs, $db; global $dolibarr_main_authentication; global $hookmanager; - global $mc; // TODO Remove this. This should not bee required because code called on MC must be inside the new hook toprightmenu - + // Instantiate hooks of thirdparty module only if not already define - if (!$hookmanager) + if (! is_object($hookmanager)) { include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($db); @@ -1324,7 +1323,7 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me $bookmarks=''; // Instantiate hooks of thirdparty module - if (!$hookmanager) + if (! is_object($hookmanager)) { include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($db);