-
-
Notifications
You must be signed in to change notification settings - Fork 824
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 - Exclude disabled custom fields #23583
Conversation
(Standard links)
|
@@ -122,6 +122,7 @@ private function addCustomFields($entity, RequestSpec $spec) { | |||
|
|||
$query = CustomField::get(FALSE) | |||
->setSelect(['custom_group_id.name', 'custom_group_id.title', '*']) | |||
->addWhere('is_active', '=', TRUE) | |||
->addWhere('custom_group_id.is_multiple', '=', '0'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@colemanw do we need to do something about the multi record custom fields as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I've updated the PR and added a test for that as well.
cf6146b
to
032c091
Compare
I tested the first demo just now and it worked fine. Waiting for the second demo to finish completing checks to test that. |
Tested the second demo and it worked fine.
|
For reference there's a longstanding discussion about whether they should or shouldn't show: #14240 (comment) and also https://lab.civicrm.org/dev/core/-/issues/19. I suppose this PR matches where it is most places. |
Ok I went back and re-read that issue, and then double-checked the APIv3 behavior, and this PR matches it (disabled custom fields are not shown in APIv3 |
Overview
Ensures that disabled custom fields do not show up in API results or in Search Kit.
Before
Disabled custom fields available in SearchKit.
After
Disabled fields hidden.