From 8b2541ebf92edff44999abd4a082d38870a2ab0e Mon Sep 17 00:00:00 2001 From: arnaud Date: Thu, 14 Jan 2016 14:10:50 +0100 Subject: [PATCH] FIX nblignes not calculated after hook and hook can't modify this value. Usefull for modules --- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 475c874ae5fec..a02ad089c5b17 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -250,6 +250,9 @@ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hid global $action; $reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + // Set nblignes with the new facture lines content after hook + $nblignes = count($object->lines); + // Create pdf instance $pdf=pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance