From aa7c1d0fe87c27f49fcb15ce2895301307773707 Mon Sep 17 00:00:00 2001 From: Yannik Firre <3316758+YannikFirre@users.noreply.github.com> Date: Tue, 22 Sep 2020 16:28:52 +0200 Subject: [PATCH 1/3] FIX - When setComplexValue is not found --- src/PhpWord/TemplateProcessor.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/PhpWord/TemplateProcessor.php b/src/PhpWord/TemplateProcessor.php index 7efc0f1ac8..7f50e3fb1a 100644 --- a/src/PhpWord/TemplateProcessor.php +++ b/src/PhpWord/TemplateProcessor.php @@ -274,6 +274,11 @@ public function setComplexValue($search, \PhpOffice\PhpWord\Element\AbstractElem $elementWriter->write(); $where = $this->findContainingXmlBlockForMacro($search, 'w:r'); + + if($where === false) { + return ; + } + $block = $this->getSlice($where['start'], $where['end']); $textParts = $this->splitTextIntoTexts($block); $this->replaceXmlBlock($search, $textParts, 'w:r'); From 15ee5dee05067dd7217a4a22e92f0780c1a3e5ac Mon Sep 17 00:00:00 2001 From: Yannik Firre <3316758+YannikFirre@users.noreply.github.com> Date: Wed, 30 Dec 2020 14:02:29 +0100 Subject: [PATCH 2/3] Fix missing space after if keyword --- src/PhpWord/TemplateProcessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpWord/TemplateProcessor.php b/src/PhpWord/TemplateProcessor.php index 7f50e3fb1a..ece29c3539 100644 --- a/src/PhpWord/TemplateProcessor.php +++ b/src/PhpWord/TemplateProcessor.php @@ -275,7 +275,7 @@ public function setComplexValue($search, \PhpOffice\PhpWord\Element\AbstractElem $where = $this->findContainingXmlBlockForMacro($search, 'w:r'); - if($where === false) { + if ($where === false) { return ; } From 24e46544d894c1d401c444ee867a50b04a6a651f Mon Sep 17 00:00:00 2001 From: troosan Date: Fri, 5 Feb 2021 21:25:21 +0100 Subject: [PATCH 3/3] remove space --- src/PhpWord/TemplateProcessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpWord/TemplateProcessor.php b/src/PhpWord/TemplateProcessor.php index ece29c3539..18ec6ec42b 100644 --- a/src/PhpWord/TemplateProcessor.php +++ b/src/PhpWord/TemplateProcessor.php @@ -276,7 +276,7 @@ public function setComplexValue($search, \PhpOffice\PhpWord\Element\AbstractElem $where = $this->findContainingXmlBlockForMacro($search, 'w:r'); if ($where === false) { - return ; + return; } $block = $this->getSlice($where['start'], $where['end']);