diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 9905cd1252a..2fb79ca56f2 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6610,7 +6610,11 @@ class Form // Can complete the possiblelink array $hookmanager->initHooks(array('commonobject')); $parameters=array('listofidcompanytoscan' => $listofidcompanytoscan); - $reshook=$hookmanager->executeHooks('showLinkToObjectBlock', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + + if (! empty($listofidcompanytoscan)) // If empty, we don't have criteria to scan the object we can link to + { + $reshook=$hookmanager->executeHooks('showLinkToObjectBlock', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + } if (empty($reshook)) { diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index fdb46b95ed9..a40e2d2ed08 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2657,7 +2657,6 @@ if (GETPOST('modelselected', 'alpha')) { if ($action != 'presend') { - /* * Generate documents */ @@ -2677,11 +2676,15 @@ if ($action != 'presend') $somethingshown = $formfile->numoffiles; } + // Disabled for expensereport, there is no thirdparty on expensereport, so nothing to define the list of other object we can suggest to link to + /* if ($action != 'create' && $action != 'edit' && ($id || $ref)) { $linktoelem = $form->showLinkToObjectBlock($object, null, array('expensereport')); $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); } + */ + print '