Replies: 1   Views: 3015
[fixed] using marginfooter with modifypagelayout old bug
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 kobbe  · 23-06-2016 - 08:18

Hey this bug exist in older versions but also in the new 6.0! Must be fixed!!!! line 4666


if (isset($layout[$paperType]['marginFooter'])) {
    $sectionNode->getElementsByTagName('pgMar')->item(0)->setAttribute('w:footer', $layout['marginFooter']);



if (isset($layout['marginFooter'])) {
    $sectionNode->getElementsByTagName('pgMar')->item(0)->setAttribute('w:footer', $layout['marginFooter']);

Posted by admin  · 23-06-2016 - 08:25


Thank you for the info. It only affect the library when setting a marginFooter with modifyPageLayout method.

This is patch to solve it if using the classic package:

diff --git a/classes/ b/classes/
index 52651e2..171433d 100755
--- a/classes/
+++ b/classes/
@@ -4663,7 +4663,7 @@ class CreateDocx extends CreateDocument
             if (isset($layout['marginHeader'])) {
                 $sectionNode->getElementsByTagName('pgMar')->item(0)->setAttribute('w:header', $layout['marginHeader']);
-            if (isset($layout[$paperType]['marginFooter'])) {
+            if (isset($layout['marginFooter'])) {
                 $sectionNode->getElementsByTagName('pgMar')->item(0)->setAttribute('w:footer', $layout['marginFooter']);
             if (isset($layout['gutter'])) {

We have fixed it in the current stable branch.