[4.x] Fix runtime behavior regression #8873
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes #8829.
An earlier PR #8818 introduced a behavior regression. While the behavior is technically correct, it doesn't play well with sites that were accidentally relying on the old behavior.
An example of where the old behavior before #8818 would apply incorrectly is when using the
asset
tag with theurl
parameter:Because
url
also matches a modifier name, the previous over-aggressive check would catch this tag and isolate its parsing/rendering. This PR re-introduces this old behavior when a tag returns an associative array, while preserving the corrected behavior #8818 was trying to achieve.This behavior regression is incredibly difficult to track down and correct within sites using a page builder-type setup, where its not obvious what's being included when/by-what. I've verified it on a site (related to the attached issue), but it is highly likely to impact more.
New tests have also been added to catch this behavior, but there is the possibility that it doesn't account for all of the weird previous behavior of having the over-aggressive check apply to everything.
Note: Regardless of which action is taken (reverting #8818) or accepting this PR, there will be strange behavior in some scenarios until it can be resolved in a breaking-change version. The easier scenario/workaround to document is the workaround that would be required by reverting #8818:
That workaround is required when the tag does not return an associative array, but does have parameters that conflict with modifier names. This is probably the better course of action (instead of accidentally breaking behavior), but I did make an attempt to keep both things working 🙂
Note 2: Adding the ability to force isolation and opt-into the previous behavior would also be an option, but would also be a breaking change and require changes to a site's template (and would be confusing to explain when that should be done).