Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
CreateDocx::clearBlocks()/CreateTemplate::deleteAllBlocks() deleted some <w:p>s in my documents that didn't contain any block placeholder and hence corrupted the document.
I managed to fix the bug with the following one-line patch:
[code]
--- phpdocx_pro/classes/CreateTemplate.inc
+++ phpdocx_pro/classes/CreateTemplate.inc
@@ -420,8 +420,8 @@
$query = 'w:r/w:t';
for ($i = 0; $i < $length; $i++) {
$variables = $xpath->query($query, $itemsWP[$i]);
+ $deleteCurrent = false;
foreach ($variables as $entry) {
- $deleteCurrent = false;
if (
strpos($entry->nodeValue,
self::$_templateSymbol . 'BLOCK_'
[/code]
Thanks, we'll check this patch to be added on phpdocx.