diff --git a/api/src/Etemplate/Widget/Customfields.php b/api/src/Etemplate/Widget/Customfields.php index 547b2ff7dc..a99a0d2887 100644 --- a/api/src/Etemplate/Widget/Customfields.php +++ b/api/src/Etemplate/Widget/Customfields.php @@ -146,9 +146,11 @@ class Customfields extends Transformer $customfields = $this->attrs['customfields']; } // Filter fields + $field_filters = $negate_fields = []; if (!empty($this->attrs['fields'])) { - $fields_name = explode(',', $this->attrs['fields']); + $fields_name = is_array($this->attrs['fields']) ? $this->attrs['fields'] : + explode(',', $this->attrs['fields']); foreach($fields_name as &$f) { if ($f[0] == "!") @@ -491,4 +493,4 @@ class Customfields extends Transformer //error_log(__METHOD__."() $form_name $field: ".array2string($value).' --> '.array2string($value)); } } -} +} \ No newline at end of file