APIv4 SortableEntity - Fix sorting custom fields with option groups
authorColeman Watts <coleman@civicrm.org>
Sun, 6 Feb 2022 20:01:20 +0000 (15:01 -0500)
committerColeman Watts <coleman@civicrm.org>
Mon, 7 Feb 2022 06:30:51 +0000 (01:30 -0500)
commit204c3c298e7ceae85a1b8f8b9091bd1042dd49b7
tree33948a8271f40c993e8c9096ec66b4ec4ac02be3
parent6c43540ae2cd16db8af285e18f57b41bb439f703
APIv4 SortableEntity - Fix sorting custom fields with option groups

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.
Civi/Api4/CustomField.php
Civi/Api4/Entity.php
Civi/Api4/Generic/Traits/DAOActionTrait.php
Civi/Api4/MembershipType.php
Civi/Api4/Navigation.php
Civi/Api4/OptionValue.php
Civi/Api4/PriceField.php
Civi/Api4/PriceFieldValue.php
Civi/Api4/UFField.php
Civi/Api4/Utils/ReflectionUtils.php
tests/phpunit/api/v4/Action/BasicCustomFieldTest.php