Forum


Replies: 6   Views: 2656
Version 5.5 : variables not set in multimerge.inc
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.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by admin  · 24-01-2018 - 09:15

Hello,

You can apply this patch to remove that notices in phpdocx 5.5 namespaces (MultiMerge.inc file):

@@ -1947,7 +1947,7 @@
                 if (is_object($lastNode->firstChild) && $lastNode->firstChild->nodeName == 'w:pPr') {
                     //check the name of the last child
                     if (is_object($lastNode->firstChild->lastChild) && $lastNode->firstChild->lastChild->nodeName == 'w:pPrChange') {
-                        $lastNode->firstChild->lastChild->parentNode->insertBefore($sectNode, $lastParagraph->firstChild->lastChild);
+                        $lastNode->firstChild->lastChild->parentNode->insertBefore($sectNode, $lastNode->firstChild->lastChild);
                     } else {
                         $lastNode->firstChild->appendChild($sectNode);
                     }
@@ -2215,6 +2215,7 @@
         $mergedRelsNodes = $mergedXPath->query($query);
         foreach ($mergedRelsNodes as $node) {
             $target = $node->getAttribute('Target');
+            $currentId = $node->getAttribute('Id');
             //We are going to filter the CustomXML, glossary and .bin files that we are not going to import by the time being
             if (strstr($target, 'customXml') === false &&
                     strstr($target, 'glossary') === false &&
@@ -2248,7 +2249,7 @@
             $queryId = '//rels:Relationship[@Id="' . $currentId . '"]';
             $currentIdNodes = $originalXPath->query($queryId);
             if ($currentIdNodes->length == 0) {
-                $queryId = '//rels:Relationship[@Id="' . $curentId . '"]';
+                $queryId = '//rels:Relationship[@Id="' . $currentId . '"]';
                 $newRelationshipNode = $myOriginalRels->importNode($node, true);
                 $myOriginalRels->documentElement->appendChild($newRelationshipNode);
             }

Regards.