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
Redeclaring a layout fragment in a decoration template that is part of a hierarchy of nested templates yields the wrong results #200
Comments
Fixing the include/replace/insert problem without just documenting the fact that one must not redeclare a given layout:fragment, requires changes to the FragmentMap, e.g.
Also, IncludeProcessor, InsertProcessor and ReplaceProcessor must now call setForNodeIncludeProcessing instead of just setForNode. By making this change, everything seems to be working just fine. |
…n hierarchies must produce the expected result
Any progress on this? We got bitten by this issue upgrading from |
There's a linked PR to fix this issue, and I had some changes I wanted to see made to it in my review, but I haven't heard back from the OP about updates 😕 I'll apply the PR + changes and release a 2.5.2-SNAPSHOT in the coming days. |
Great! thanks @ultraq :) |
@ultraq Oh I am sorry. I completely forgot about this 😄 . And what is worse is that my MB Pro broke and I am no longer able to access the worktree where I already implemented some of the suggested changes. |
That's OK @silkentrance - it turns out I wrote some pretty thorough review notes, so I was planning to merge your PR as is, and then apply exactly what I wrote in that PR on top of your changes 😁 |
fix #200: redeclaration of layout fragments in nested decoration hierarchies must produce the expected result
Version 2.5.2-SNAPSHOT, which contains the linked PR and merged into the latest code, is now available to try. |
It works like a charm. Thanks for the quick fix! |
Awesome, I'll make a release some time this weekend and post in this issue when it's available |
Version 2.5.2 is out now 😁 It's making its way through maven central now so should show up there soon |
Having a template in a hierarchy of nested templates, that redeclares a layout fragment that was already declared in the decorated base template at the root of the hierarchy, and with the content template once again declaring the same layout fragment, the fragment declared by the decorated template will be used instead of that from the content template.
Example
The above will fail with the following output
A remedy for this is to change the FragmentProcessor to use the last fragment instead of the first, e.g.
Doing so will make the tests for infinite loops fail, so this might be more involved.
The text was updated successfully, but these errors were encountered: