Skip to content

cloneBlock dont work #1148

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

Closed
mathiastm opened this issue Sep 27, 2017 · 2 comments
Closed

cloneBlock dont work #1148

mathiastm opened this issue Sep 27, 2017 · 2 comments

Comments

@mathiastm
Copy link

mathiastm commented Sep 27, 2017

Hi everyone, i have one Word documment "test1.docx" with one block ${MYBLOCK} ... ${/MYBLOCK}.
in this document the cloneBlock function work well but in an other document i have the same block but the preg_match function in cloneBlock() match nothing...
i dumped the $matches variable.

in my first document

array:5 [▼
  0 => """
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n
    <w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" x ▶
    """
  1 => """
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n
    <w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" x ▶
    """
  2 => "<w:p w:rsidR="005A380F" w:rsidRDefault="005A380F" w:rsidP="00662B52"><w:r w:rsidRPr="00CD65D3"><w:rPr><w:highlight w:val="yellow"/></w:rPr><w:t>${BOUCLE1_CLIENT ▶"
  3 => "<w:p w:rsidR="005A380F" w:rsidRDefault="00A8472A" w:rsidP="00105810"><w:pPr><w:ind w:left="1418"/></w:pPr><w:r><w:t>${CONT/ETATCIVIL}</w:t></w:r><w:r w:rsidR="0 ▶"
  4 => "<w:p w:rsidR="005A380F" w:rsidRDefault="005A380F" w:rsidP="00662B52"><w:r w:rsidRPr="00CD65D3"><w:rPr><w:highlight w:val="yellow"/></w:rPr><w:t>${/BOUCLE1_CLIEN ▶"
]

in the second :

[]

any ideas?

@FBnil
Copy link

FBnil commented Sep 28, 2017

Keep a look out on this #1147
Are you using PHP7?
Can you make a small document for me where it does not work? I can then add it as a testcase (to ensure the consistency of fixes). Email it to me at Email-address-redacted .
If you are savvy enough, try replacing my version of TemplateProcessor.php in your vendor directory and see how it goes then.

@mathiastm
Copy link
Author

Thank you @FBnil for your answer,I finally found a solution using DOMDocument and DOMXPath classes.
have a good day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants