From c48e2dccf1c91beae1bf059fe942f3143245fed9 Mon Sep 17 00:00:00 2001 From: ralf Date: Mon, 6 Feb 2023 20:38:14 +0100 Subject: [PATCH] fix explode(): Argument #2 ($string) must be of type string, array given --- api/src/Etemplate/Widget/Customfields.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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