From 4a65b23bbf99a8c01722f2e16cd643b5ae523811 Mon Sep 17 00:00:00 2001 From: John Botella Date: Wed, 23 Sep 2020 15:35:17 +0200 Subject: [PATCH] Fix missing fetch optionals --- htdocs/core/modules/livraison/doc/pdf_storm.modules.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/livraison/doc/pdf_storm.modules.php b/htdocs/core/modules/livraison/doc/pdf_storm.modules.php index 6a8aabbcf16..7054f6ddc3e 100644 --- a/htdocs/core/modules/livraison/doc/pdf_storm.modules.php +++ b/htdocs/core/modules/livraison/doc/pdf_storm.modules.php @@ -157,7 +157,7 @@ class pdf_storm extends ModelePDFDeliveryOrder /** * Function to build pdf onto disk * - * @param Object $object Object to generate + * @param Livraison $object Object to generate * @param Translate $outputlangs Lang output object * @param string $srctemplatepath Full path of source filename for generator using a template file * @param int $hidedetails Do not show line details @@ -417,6 +417,11 @@ class pdf_storm extends ModelePDFDeliveryOrder // Loop on each lines for ($i = 0; $i < $nblines; $i++) { + // Fetch optionals + if(empty($object->lines[$i]->array_options)){ + $object->lines[$i]->fetch_optionals(); + } + $curY = $nexY; $pdf->SetFont('', '', $default_font_size - 1); // Into loop to work with multipage $pdf->SetTextColor(0, 0, 0);