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
Runtime: Preserve builder instances when being supplied in dynamic bindings and modifiers, or when they've been scoped/nested #5807
Runtime: Preserve builder instances when being supplied in dynamic bindings and modifiers, or when they've been scoped/nested #5807
Conversation
Awesome! |
The first two fixes are great. But I'm having trouble recreating the last bit. What can I do to reproduce the bug? I'm talking about this bit:
|
@jasonvarga This test will fail if you bring it in the main branch: cms/tests/Antlers/Runtime/AntlersQueryBuilderTest.php Lines 46 to 75 in bdbd0ca
I've spotted something else (not hitting the Cascade when it should) while making you a repository 🤦 -- will fix that as well, and then also get you a repo. |
Oh you mean when there are params on it. In your description you didn't:
|
@jasonvarga I've created a repository here that contains examples of all the different things: https://github.com/Stillat/antlers-fun-with-builders All of them are on the home page (for best results |
Thanks for that! This is a separate problem, but FYI the home page on that repo loads super slowly (almost 6s, and I'm on an M1 Mac). If I remove all the code chunks (the |
If I move the noparse chunks into partials, the page displays correct, and it's fast. |
Thanks for letting me know! I'll look into that and get that fixed up |
Kinda looks a lot to do with the size of the template. If I replace the code chunks with about the same number of regular text characters, the load time jumps up. Anyway, getting off topic. Thanks again for the repo. |
This PR adjusts the behavior of query builder instances to bring parity with Regex:
Builders are left alone when being passed as tag parameters (closes #5811 ):
Builders are left alone in modifiers:
Example of scoped/nested behavior that previously broken (has to be a tag pair to be broken):
Additionally, this PR adds extra test coverage to make sure that any resolved query builder values are not leaked in other nested scopes (allowing for changing query parameters, sort order, etc.)