SearchKit - Fix and add test for scenario where the same display is used twice on a form #27698
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.
Overview
Enables the scenario where the same search display is reused with different filters on the same form.
Before
Doesn't work.
After
Works. Test added.
Comments
I originally hit this bug when working on the Contact Relationships Tab. My first draft of that PR used the exact same display twice & passed each a different value for
is_current
. The current iteration of that PR actually uses different displays because there were a few things about them (styling, links) I wanted to tweak. So I spun off this fix into its own PR as it's no longer on the critical path.The Afform GUI still doesn't handle this scenario well, but that's another issue. IMO this is fine to merge as-is. It's an improvement and has a test.