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

Fixed: Endless loop if more than one parent without the macro exists #3046

Merged
merged 1 commit into from Jun 3, 2019
Merged

Fixed: Endless loop if more than one parent without the macro exists #3046

merged 1 commit into from Jun 3, 2019

Conversation

nea
Copy link
Contributor

@nea nea commented Jun 3, 2019

Hi @fabpot

I made a quick fix for the parent macro method call fix you did for me in #3042. Your code works in case the direct parent has the macro. But if there is a longer hierarchy and the looked for macro is in a parent template +1 it runs into an endless loop because the ->getParent() method is always called on $template but never the newer $parent.

Best

@fabpot
Copy link
Contributor

fabpot commented Jun 3, 2019

oops, good catch!

@fabpot
Copy link
Contributor

fabpot commented Jun 3, 2019

Thank you @nea.

@fabpot fabpot merged commit 4497083 into twigphp:2.x Jun 3, 2019
fabpot added a commit that referenced this pull request Jun 3, 2019
…ro exists (nea)

This PR was squashed before being merged into the 2.x branch (closes #3046).

Discussion
----------

Fixed: Endless loop if more than one parent without the macro exists

Hi @fabpot

I made a quick fix for the parent macro method call fix you did for me in #3042. Your code works in case the direct parent has the macro. But if there is a longer hierarchy and the looked for macro is in a parent template +1 it runs into an endless loop because the `->getParent()` method is always called on `$template` but never the newer `$parent`.

Best

Commits
-------

4497083 Fixed: Endless loop if more than one parent without the macro exists
@stof
Copy link
Member

stof commented Jun 3, 2019

a test should be added covering this.

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

Successfully merging this pull request may close these issues.

None yet

3 participants