Forum


Replies: 6   Views: 2848
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 Bouillou  · 23-01-2018 - 10:21

Hello,

Refferring to topic https://www.phpdocx.com/en/forum/default/topic/1132

I am using the version 5.5 and some variables are not set or misspelled.

Do you have a fixed version for the MultiMerge.inc file?

Best regards,

Sébastien

Posted by admin  · 23-01-2018 - 15:30

Hello,

Each new release of phpdocx adds new features. In the case of MultiMerge, a lot of improvements (options, in-memory merging) has been added to the class since phpdocx 5.5. That PHP notices were removed as well.

If you need a patch for phpdocx 5.5 to remove the PHP notices please reply the topic again and the dev team will post it.

Regards.

Posted by Bouillou  · 23-01-2018 - 19:24

Dear support,

A patch would be very useful to me.

Best regards,

Sebastien

Posted by admin  · 24-01-2018 - 07:56

Hello,

Which package are you using? Classic or namespaces?

Regards.

Posted by Bouillou  · 24-01-2018 - 08:58

The namespace one.

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.

Posted by Bouillou  · 24-01-2018 - 13:40

Ok, thanks.