FIX: Missing reference and page sync in printStdColumnContent hook (#37639)

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
atm-jonathan 2026-03-29 22:29:38 +02:00 committed by GitHub
parent de408370e9
commit cfbe765d48
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View file

@ -1582,15 +1582,18 @@ abstract class CommonDocGenerator
$parameters = array(
'curY' => &$curY,
'columnText' => $columnText,
'columnText' => &$columnText,
'colKey' => $colKey,
'pdf' => &$pdf,
);
$reshook = $hookmanager->executeHooks('printStdColumnContent', $parameters, $this); // Note that $action and $object may have been modified by hook
if ($reshook > 0 && isset($hookmanager->resArray['columnText'])) {
$columnText = $hookmanager->resArray['columnText'];
}
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
if (!$reshook) {
if (!$reshook || $reshook > 0) {
if (empty($columnText)) {
return 0;
}

View file

@ -648,6 +648,11 @@ class pdf_octopus extends ModelePDFFactures
$pagenb = $pageposbeforeprintlines;
for ($i = 0; $i < $nblines; $i++) {
$parameters = array('i' => $i, 'object' => $object); // Ajoute 'object' ici
$reshook = $hookmanager->executeHooks('beforePrintPDFline', $parameters, $this, $action);
if ($reshook > 0 && !empty($hookmanager->resArray['object'])) {
$object = $hookmanager->resArray['object'];
}
$linePosition = $i + 1;
$curY = $nexY;