[11.x] Fix nested rules custom attribute names #51805
Merged
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.
Updated PR
Reopening previously closed PR #51785 — now with tests and refactored to support the same functionality in both inline custom attributes and translated custom attributes. A new common method
getAttributeFromLocalArray
is used to ensure equivalent functionality when pulling from either source. This PR has been crafted to match the existing functionality of custom messages where applicable as I believe this is the expected developer experience.Check these action results to see these tests failing against the current 11.x branch.
Original PR
Resolves an issue where wildcard custom attributes aren't matched when using NestedRules. See issue #51784.
The underlying cause of this issue is that NestedRules doesn't correctly generate the relevant
implicitAttributes
, meaning custom attributes cannot be connected with their explicit attributes. There doesn't seem to be a good way to fix this underlying problem without major refactoring and breaking changes.This PR resolves this issue by iterating over the custom attributes and pattern matching their keys with the given attribute. This is consistent with the way custom messages are already resolved and therefore has some precedence.