From 731d85130c702fc9414490a1784e65d9eda3ba7e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 21 Apr 2022 09:49:00 +0200 Subject: [PATCH] FIX missing hook parameter --- htdocs/core/class/html.form.class.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d656fbde897..6a7bd9a688f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8404,7 +8404,7 @@ class Form public function showLinkToObjectBlock($object, $restrictlinksto = array(), $excludelinksto = array()) { global $conf, $langs, $hookmanager; - global $bc, $action; + global $action; $linktoelem = ''; $linktoelemlist = ''; @@ -8450,11 +8450,10 @@ class Form ); } - // Can complete the possiblelink array - $hookmanager->initHooks(array('commonobject')); - $parameters = array('listofidcompanytoscan' => $listofidcompanytoscan); - if (!empty($listofidcompanytoscan)) { // If empty, we don't have criteria to scan the object we can link to + // Can complete the possiblelink array + $hookmanager->initHooks(array('commonobject')); + $parameters = array('listofidcompanytoscan' => $listofidcompanytoscan, 'possiblelinks' => $possiblelinks); $reshook = $hookmanager->executeHooks('showLinkToObjectBlock', $parameters, $object, $action); // Note that $action and $object may have been modified by hook }