From 5d4fdd67c64a16cfc9c74ac292924475f7b499ab Mon Sep 17 00:00:00 2001 From: nathan Date: Mon, 16 Oct 2023 11:05:44 -0600 Subject: [PATCH] Api: Fix customfield field attribute was not always applied If attribute was set, sometimes it was overwritten and all cf were used. Happened trying to get only some addressbook custom fields showing on registration page --- api/src/Etemplate/Widget/Customfields.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/Etemplate/Widget/Customfields.php b/api/src/Etemplate/Widget/Customfields.php index a5674bbcdc..a2270d1d78 100644 --- a/api/src/Etemplate/Widget/Customfields.php +++ b/api/src/Etemplate/Widget/Customfields.php @@ -176,7 +176,7 @@ class Customfields extends Transformer } // Remove filtered fields - if (!empty($field_filters) && in_array($key, $negate_fields) && in_array($key, $field_filters)) + if(!empty($field_filters) && !in_array($key, $field_filters) || !empty($negate_fields) && in_array($key, $negate_fields)) { unset($fields[$key]); }