FIX: Missing reference and page sync in printStdColumnContent hook (#37639)
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
parent
de408370e9
commit
cfbe765d48
2 changed files with 10 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue