From 4ee7657dcaa2bd3fa63bbcafd911ad54eefec4f6 Mon Sep 17 00:00:00 2001 From: w3houde Date: Fri, 12 Jun 2026 00:05:38 +0200 Subject: [PATCH] Fix #35815 initHooks on payment document.php pages (#38707) compta/paiement/document.php and fourn/paiement/document.php expose $hookmanager via the @var docblock but never call initHooks, so the include of core/actions_linkedfiles.inc.php and the rest of the page can't run any custom-module hook context. Add an initHooks() right after loadLangs, mirroring the pattern used by commande/document.php (orderdocument, globalcard). Use paymentdocument / paymentsupplierdocument for the two pages. Signed-off-by: Dolicraft Co-authored-by: Dolicraft --- htdocs/compta/paiement/document.php | 2 ++ htdocs/fourn/paiement/document.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/htdocs/compta/paiement/document.php b/htdocs/compta/paiement/document.php index 479bb790e4a..c6904259c93 100644 --- a/htdocs/compta/paiement/document.php +++ b/htdocs/compta/paiement/document.php @@ -52,6 +52,8 @@ if (isModEnabled('project')) { // Load translation files required by the page $langs->loadLangs(array('bills', 'banks', 'companies', 'suppliers', 'other')); +$hookmanager->initHooks(array('paymentdocument', 'globalcard')); + $id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); diff --git a/htdocs/fourn/paiement/document.php b/htdocs/fourn/paiement/document.php index 4d6785074f1..779ade183f0 100644 --- a/htdocs/fourn/paiement/document.php +++ b/htdocs/fourn/paiement/document.php @@ -54,6 +54,8 @@ if (isModEnabled('project')) { // Load translation files required by the page $langs->loadLangs(array('banks', 'bills', 'companies', 'suppliers', 'other')); +$hookmanager->initHooks(array('paymentsupplierdocument', 'globalcard')); + // Get Parameters $id = GETPOSTINT('id');