From 0027335e3bd3f8fb3fe07611982be1b7160bdbf0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Dec 2021 03:25:07 +0100 Subject: [PATCH] Fix regression --- htdocs/core/lib/pdf.lib.php | 8 ++------ test/phpunit/PdfDocTest.php | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 668ba11b58e..735e6892fcd 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1418,10 +1418,6 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, // Description long of product line if (!empty($desc) && ($desc != $label)) { - if ($libelleproduitservice && empty($hidedesc)) { - $libelleproduitservice .= '__N__'; - } - if ($desc == '(CREDIT_NOTE)' && $object->lines[$i]->fk_remise_except) { $discount = new DiscountAbsolute($db); $discount->fetch($object->lines[$i]->fk_remise_except); @@ -1547,7 +1543,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, // Adding the descriptions if they are filled $desccateg = $cate->description; if ($desccateg) { - $libelleproduitservice .= '__N__'.$desccateg; + $libelleproduitservice = dol_concatdesc($libelleproduitservice, $desccateg); } } } @@ -1572,7 +1568,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, } $libelleproduitservice .= '
'.$period.''; } else { - $libelleproduitservice .= "__N__".$period; + $libelleproduitservice = dol_concatdesc($libelleproduitservice, $period); } //print $libelleproduitservice; } diff --git a/test/phpunit/PdfDocTest.php b/test/phpunit/PdfDocTest.php index f7181f8a4f9..35350c3bdae 100644 --- a/test/phpunit/PdfDocTest.php +++ b/test/phpunit/PdfDocTest.php @@ -160,11 +160,11 @@ class PdfDocTest extends PHPUnit\Framework\TestCase $result=pdf_getlinedesc($localobject, 0, $langs); print __METHOD__." result=".$result."\n"; - $this->assertEquals($result, "PINKDRESS - Label 1
This is a description with a é accent
(Country of origin: France)"); + $this->assertEquals("PINKDRESS - Label 1
This is a description with a é accent
(Country of origin: France)", $result); $result=doc_getlinedesc($localobject->lines[0], $langs); print __METHOD__." result=".$result."\n"; - $this->assertEquals($result, "PINKDRESS - Label 1\nThis is a description with a é accent\n(Country of origin: France)"); + $this->assertEquals("PINKDRESS - Label 1\nThis is a description with a é accent\n(Country of origin: France)", $result); } /**