diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 466faba295e..d53072efe0a 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -6444,6 +6444,11 @@ class Form
else $morehtmlstatus=$hookmanager->resPrint;
if ($morehtmlstatus) $ret.='
'.$morehtmlstatus.'
';
+ $parameters = array();
+ $reshook = $hookmanager->executeHooks('moreHtmlRef', $parameters, $object); // Note that $action and $object may have been modified by hook
+ if (empty($reshook)) $morehtmlref.=$hookmanager->resPrint;
+ elseif ($reshook > 0) $morehtmlref=$hookmanager->resPrint;
+
// Left part of banner
if ($morehtmlleft)
{
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index f58d733a4e6..d908f60b35a 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -1554,11 +1554,6 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
$morehtmlref.='';
}
- $parameters = array();
- $reshook = $hookmanager->executeHooks('moreHtmlRef', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
- if (empty($reshook)) $morehtmlref.=$hookmanager->resPrint;
- elseif ($reshook > 0) $morehtmlref=$hookmanager->resPrint;
-
print '';
print $form->showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlstatus, $morehtmlright);
print '
';