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 <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
This commit is contained in:
w3houde 2026-06-12 00:05:38 +02:00 committed by GitHub
parent f282afcd62
commit 4ee7657dca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View file

@ -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');

View file

@ -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');