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

Fix {foreach} loops when the to-be-iterated value is empty #4431

Merged
merged 1 commit into from
Aug 3, 2021

Conversation

TimWolla
Copy link
Member

@TimWolla TimWolla commented Aug 3, 2021

The restoring of the item value failed, because the necessary data in
foreachVars was only being filled when the foreach() loop was actually
entered. Move this saving of the old value up to ensure it always happens.

see 75ce18b
see #4425

The restoring of the `item` value failed, because the necessary data in
`foreachVars` was only being filled when the `foreach()` loop was actually
entered. Move this saving of the old value up to ensure it always happens.

see 75ce18b
see #4425
@TimWolla TimWolla added the Bug label Aug 3, 2021
@TimWolla TimWolla requested a review from BurntimeX August 3, 2021 07:57
@BurntimeX BurntimeX merged commit 461b475 into 5.3 Aug 3, 2021
@BurntimeX BurntimeX deleted the foreach-empty branch August 3, 2021 08:56
dtdesign added a commit that referenced this pull request Aug 8, 2021
Nesting the same template inside a `foreach` loop that is also accessed inside the nested call will overwrite the values from the outer template due to identical identifiers being used.

The sandbox did not protected `$this->foreachVars` despite being stateful.

See #4431
Fixes #4444
dtdesign added a commit that referenced this pull request Sep 8, 2021
Nesting the same template inside a `foreach` loop that is also accessed inside the nested call will overwrite the values from the outer template due to identical identifiers being used.

The sandbox did not protected `$this->foreachVars` despite being stateful.

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

Successfully merging this pull request may close these issues.

None yet

2 participants