CustomGroup - Add metadata about how a custom group relates to entity types
authorColeman Watts <coleman@civicrm.org>
Sun, 1 May 2022 21:54:54 +0000 (17:54 -0400)
committerColeman Watts <coleman@civicrm.org>
Wed, 4 May 2022 22:13:02 +0000 (18:13 -0400)
commit3d2f86c56ea4e053ed133053e9f3c8f902aee27f
tree07e609f92211b75ee22d162eec7fc26889e2f7a3
parentd6c6a0ca063d02c654eceada8bca07d99c95101c
CustomGroup - Add metadata about how a custom group relates to entity types

Fixes dev/core#2905
Before: Hard coded, plus a very strange use of the 'description' field to store a callback function.

After: The 'grouping' field in the OptionValue for custom extends and custom type is used.
APIv4 getfields can then retrieve the necessary options.
14 files changed:
CRM/Core/BAO/CustomGroup.php
CRM/Core/DAO/CustomGroup.php
CRM/Core/PseudoConstant.php
CRM/Core/SelectValues.php
CRM/Custom/Page/Group.php
CRM/Upgrade/Incremental/sql/5.50.alpha1.mysql.tpl
Civi/Api4/Utils/CoreUtil.php
Civi/Api4/Utils/FormattingUtil.php
ext/civigrant/managed/OptionValue_cg_extends_objects_grant.mgd.php [new file with mode: 0644]
tests/phpunit/CRM/Core/BAO/CustomGroupTest.php
tests/phpunit/api/v4/Action/BasicCustomFieldTest.php
tests/phpunit/api/v4/Entity/CaseTest.php
xml/schema/Core/CustomGroup.xml
xml/templates/civicrm_data.tpl