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

Prevent infinite loop when tokens are used in headers or footers #72

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

dontub
Copy link
Contributor

@dontub dontub commented Nov 8, 2024

Fixes #71.

Note: setValue() replaces all variables in the document since 0.13.0 (PHPOffice/PHPWord#618) so it's not necessary to execute it in a loop.

I'll add another issue regarding replacement of variables in footers and headers.

systopia-reference: 27046

@dontub
Copy link
Contributor Author

dontub commented Nov 13, 2024

Strange that Assert\Assertion is not found in this test and only affects one container. Though this is independent of this change.

@dontub dontub requested a review from jensschuppe November 15, 2024 13:31
@jensschuppe
Copy link
Contributor

jensschuppe commented Nov 29, 2024

Does this fix things only in PHPOffice/PHPWord 0.13.0? Do we need to define version constraints for this library with this change?

@dontub
Copy link
Contributor Author

dontub commented Dec 2, 2024

Does this fix things only in PHPOffice/PHPWord 0.13.0? Do we need to define version constraints for this library with this change?

Moving the call of setValue() outside of the loop can be done with PHPOffice/PHPWord >=0.13.0. CiviCRM 5.54 (which is stated as compatible in the info.xml) requires ^0.18.0 so we can safely do this change. Defining a version constraint is therefore not necessary.

@dontub dontub merged commit 0b32acb into master Dec 3, 2024
9 of 10 checks passed
@dontub dontub deleted the prevent-infite-loop branch December 3, 2024 08:23
@dontub
Copy link
Contributor Author

dontub commented Dec 3, 2024

I'll add another issue regarding replacement of variables in footers and headers.

Here it is: #74.

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

Successfully merging this pull request may close these issues.

Infinite loop with tokens in headers and footers
2 participants