From 37401df1062f509adc93321a8484af23b4532858 Mon Sep 17 00:00:00 2001 From: Laurent Dinclaux Date: Wed, 8 Jul 2020 14:48:34 +1100 Subject: [PATCH 1/2] Improve printStdColumnContent by passing the $pdf object. It isn't possible to replace the pdf edition done by this method without the $pdf object. --- htdocs/core/class/commondocgenerator.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 72d45f2467c..a8d5fac0c3c 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -1082,7 +1082,8 @@ abstract class CommonDocGenerator $parameters = array( 'curY' => &$curY, 'columnText' => $columnText, - 'colKey' => $colKey + 'colKey' => $colKey, + 'pdf' => $pdf, ); $reshook = $hookmanager->executeHooks('printStdColumnContent', $parameters, $this); // Note that $action and $object may have been modified by hook if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); From 3cdabbaafff7c338aa5e7bce3e5dcda90c1eeae1 Mon Sep 17 00:00:00 2001 From: Laurent Dinclaux Date: Sun, 19 Jul 2020 21:53:06 +1100 Subject: [PATCH 2/2] Explicitly pass the pdf object by reference in the printStdColumnContent hook call. --- htdocs/core/class/commondocgenerator.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index a8d5fac0c3c..f66430e30a2 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -1083,7 +1083,7 @@ abstract class CommonDocGenerator 'curY' => &$curY, 'columnText' => $columnText, 'colKey' => $colKey, - 'pdf' => $pdf, + 'pdf' => &$pdf, ); $reshook = $hookmanager->executeHooks('printStdColumnContent', $parameters, $this); // Note that $action and $object may have been modified by hook if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');