Reporting #18: Fix sorting with > 10 participant roles #21975
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.
https://lab.civicrm.org/dev/report/-/issues/18
Overview
This is based on the feedback in #14982.
To replicate this bug, you need at least ten participant roles. The first one's value should be 1. Searching on this value will return any participant whose role BEGINS with a 1 (i.e. 10, 11, 100, etc.) rather than just records whose participant role value IS 1.
Before
Searching for a participant role will return all participants whose value begins with the value you're searching for.
After
Participant list is filtered correctly.
Technical Details
This report had an overridden
where()
method to filteris_test
, but as @yashodha pointed out on #14982, this isn't a very good way to handle this.Comments
I've been carrying #14982 as a custom patch for 2 years, I realized that the proper fix wasn't all that hard after all. The parent
where()
has been refactored a couple of times so it was a bit of work to trace through, but it all looks correct.