From 03587c2dc461d125a4b03cd915cdfa1d0d4d02ff Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 15 Aug 2023 15:26:46 -0600 Subject: [PATCH] Fix doubled single customfields when one custom field had options from file --- api/src/Etemplate/Widget/Customfields.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/Etemplate/Widget/Customfields.php b/api/src/Etemplate/Widget/Customfields.php index 664181bf37..a5674bbcdc 100644 --- a/api/src/Etemplate/Widget/Customfields.php +++ b/api/src/Etemplate/Widget/Customfields.php @@ -240,9 +240,9 @@ class Customfields extends Transformer } } // need to encode values/select-options to keep their order - foreach($customfields as &$data) + foreach($customfields as $cf_name => &$data) { - if (!empty($data['values'])) + if(!empty($fields[$cf_name]) && !empty($data['values'])) { // Full URL for options from file if(!empty($data['values']['@']) && strpos($data['values']['@'], '/') == 0 && !str_contains($data['values']['@'], 'webdav.php') &&