Skip to content

fix: stop include for/with iteration once the partial interrupts - #2143

Open
nagibatorz wants to merge 2 commits into
Shopify:mainfrom
nagibatorz:nagibatorz/include-for-interrupt-2141
Open

nagibatorz wants to merge 2 commits into
Shopify:mainfrom
nagibatorz:nagibatorz/include-for-interrupt-2141

Conversation

@nagibatorz

Copy link
Copy Markdown

Fixes #2141. The partial is rendered for every item without checking for an interrupt in between, so each item pushes another BreakInterrupt/ContinueInterrupt. The enclosing for loop pops only one and the leftovers stop the rest of the template. Stop iterating once the partial raises an interrupt. Validation: new test fails on clean main and passes with the fix; full suite 1063 runs, 0 failures.

…ing loop

Each item rendered by include for/with pushes its own
BreakInterrupt/ContinueInterrupt, but the enclosing for loop pops
only one, so the leftovers stop the rest of the template. Repro
for Shopify#2141.
The partial is rendered for every item without checking for an
interrupt in between, so each item pushes another BreakInterrupt or
ContinueInterrupt. The enclosing for loop pops only one and the
leftovers stop the rest of the template. Stop iterating once the
partial raises an interrupt, like for does. Fixes Shopify#2141.

This branch has not been deployed

No deployments
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.

break/continue in a partial included with or for an array stops the rest of the template

1 participant