Afform - support filters in custom contactRef & core entityRef fields
authorColeman Watts <coleman@civicrm.org>
Tue, 25 Oct 2022 02:11:50 +0000 (22:11 -0400)
committerColeman Watts <coleman@civicrm.org>
Thu, 10 Nov 2022 17:34:45 +0000 (12:34 -0500)
commite9fe23ef3a8ee33ee89125b0a9fc3d93e7afa094
treec43de038ea6df3be0eb11fc7857f75e7894b0b2f
parentd02d4bc7042ad703f42f86438318ac3db80fb698
Afform - support filters in custom contactRef & core entityRef fields

Fixes dev/core#3425
Provides a common format for "filters" in both core and custom entityRef fields.
For example, the `employer_id` field now automatically filters `contact_type=Organization`.
Custom fields use the same format for filters (basically URL encoded format),
and APIv4 now reads them both and applies them when the field is included in an Afform.
12 files changed:
CRM/Contact/DAO/Contact.php
CRM/Contact/Form/Edit/Individual.php
CRM/Core/CodeGen/Specification.php
CRM/Core/Form.php
Civi/Api4/Generic/Traits/SavedSearchInspectorTrait.php
Civi/Api4/Service/Spec/SpecFormatter.php
ext/afform/core/Civi/Api4/Subscriber/AutocompleteSubscriber.php
ext/afform/mock/tests/phpunit/api/v4/AfformAutocompleteUsageTest.php
tests/phpunit/api/v4/Action/GetFieldsTest.php
tests/phpunit/api/v4/Custom/CustomFieldGetFieldsTest.php
xml/schema/Contact/Contact.xml
xml/templates/dao.tpl