-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Template replace not working in footer #2002
Labels
Comments
is there any update on this? i also having the same issue |
no update on this?! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the Bug
Some of the word documents(docx) that we create have only word/footer.xml or word/header.xml for the footer/header information.
With this logic, it looks like they are being skipped from replacing as the TemplateReplacement logic in https://github.com/PHPOffice/PHPWord/blob/develop/src/PhpWord/TemplateProcessor.php#L119 and https://github.com/PHPOffice/PHPWord/blob/develop/src/PhpWord/TemplateProcessor.php#L124 only seem to look for documents with word/footer<number>.xml and word/header<number>.xml
Shouldnt it also check for the simple word/header.xml and word/footer.xml ?
Steps to Reproduce
Attached word document when expanded will show the word/footer.xml and word/header.xml.. Trying to run a template replace on this avoids replacing any tags that are available in the footer (Because of the logic mentioned above).
This seems to happen only on Word docs created online, not the desktop version
Expected Behavior
The expected behaviour is for all template variables to get replaced
Current Behavior
Only variables in the main body get replaced and not the header/footer
Context
Test file
Karnan's Custom Form-1.docx
The text was updated successfully, but these errors were encountered: