Skip to content
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

cloneBlock/deleteBlock #2353

Open
peterfromhungary opened this issue Dec 7, 2022 · 3 comments
Open

cloneBlock/deleteBlock #2353

peterfromhungary opened this issue Dec 7, 2022 · 3 comments

Comments

@peterfromhungary
Copy link

peterfromhungary commented Dec 7, 2022

Hi everybody,

How is it possible that this code in the same template sometimes works and sometimes not

Template docx contains block eg.:
${BlockName}
<spreadsheet.....>
${/BlockName}

Képernyőfotó 2022-12-07 - 16 46 17

php code is:
$templateProcessor->cloneBlock('returnblock', 0, true, false, null);

After generate document by templateprocessor I want to get this output:
Képernyőfotó 2022-12-07 - 16 49 38

I have tried to put this code to the beginning or the end, but it not works always.
I have tried the following codes also to clear the block, but it not works, and templateprocessor not deleted the returnblock.

$templateProcessor->deleteBlock('returnblock');
$templateProcessor->cloneBlock('returnblock', 0, true, true);
$templateProcessor->cloneBlock('returnblock', 0, true);
$templateProcessor->replaceBlock('returnblock', '');

Does anyone know what is the secret?

@Chemical-Coder
Copy link

see there : #2217
try :

ini_set("pcre.backtrack_limit", "23001337");
ini_set("pcre.recursion_limit", "23001337");

@LeftToast
Copy link

$doc->deleteBlock('blockName'); doesn't work.

but

$doc->replaceBlock('blockName', '' ); works

except that you then have to delete the tags as well.

$doc->setValues(array('blockName' => '', '/blockName' => '' ));

@khrismuc
Copy link

see there : #2217 try :

ini_set("pcre.backtrack_limit", "23001337");
ini_set("pcre.recursion_limit", "23001337");

This just saved me from giving up on a big, paid project!

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

5 participants