Skip to content
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

APIv4 SortableEntity - Fix sorting custom fields with option groups #22716

Merged
merged 1 commit into from
Feb 7, 2022

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Feb 6, 2022

Overview

Fixes a bug in the new APIv4-based sorting which caused custom fields to be incorrectly sorted in the new SearchKit-based Admin UI extension.

Before

APIv4 would guess which fields to use for grouping when sorting by weight.
This caused a bug when sorting custom fields which also had an option_group_id, which was incorrectly guessed to be used for grouping.

After

New @groupWeightsBy annotation removes the guesswork, custom fields are sorted correctly.

Comments

Once this is merged it will unblock #22628

@civibot
Copy link

civibot bot commented Feb 6, 2022

(Standard links)

@civibot civibot bot added the 5.47 label Feb 6, 2022
@demeritcowboy
Copy link
Contributor

jenkins retest this please

Before: APIv4 would guess which fields to use for grouping when sorting by weight.
this caused a bug when sorting custom fields which also had an option_group_id, which
was incorrectly guessed to be used for grouping.

After: New `@groupWeightsBy` annotation removes the guesswork.
@colemanw
Copy link
Member Author

colemanw commented Feb 7, 2022

@demeritcowboy this is passing now

@demeritcowboy demeritcowboy merged commit 205d1cb into civicrm:5.47 Feb 7, 2022
@colemanw colemanw deleted the sortableEntityFix branch November 8, 2022 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants