diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 082080a0316e6..8d8022a026465 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -207,7 +207,7 @@ function showdocuments($modulepart,$filename,$filedir,$urlsource,$genallowed,$de
return $this->getDocumentsLink($modulepart, $filename, $filedir);
}
$printer = ($user->rights->printipp->read && $conf->printipp->enabled)?true:false;
-
+ $hookmanager->initHooks(array('formfile'));
$forname='builddoc';
$out='';
$var=true;
@@ -450,9 +450,7 @@ function showdocuments($modulepart,$filename,$filedir,$urlsource,$genallowed,$de
$langs->load("errors");
$genbutton.= ' '.img_warning($langs->transnoentitiesnoconv("WarningNoDocumentModelActivated"));
}
-
if (! $allowgenifempty && ! is_array($modellist) && empty($modellist) && empty($conf->dol_no_mouse_hover) && $modulepart != 'unpaid') $genbutton='';
-
$out.= $genbutton;
$out.= '';