diff --git a/src/Rest/Routes/AbstractUtilsBaseRoute.php b/src/Rest/Routes/AbstractUtilsBaseRoute.php index 729e8a5..1ec09fe 100644 --- a/src/Rest/Routes/AbstractUtilsBaseRoute.php +++ b/src/Rest/Routes/AbstractUtilsBaseRoute.php @@ -276,7 +276,13 @@ static function ($item) { // All other "normal" fields. $fieldType = $value['type'] ?? ''; $fieldValue = $value['value'] ?? ''; + $fieldName = $value['name'] ?? ''; + if (!$fieldName) { + break; + } + + // File. if ($fieldType === 'file') { $output['files'][$key] = $fieldValue ? \array_merge( $value, @@ -292,10 +298,17 @@ function ($item) { break; } + // Rating. if ($fieldType === 'rating' && $fieldValue === '0') { $value['value'] = ''; } + // Checkbox. + if ($fieldType === 'checkbox') { + $fieldValue = \explode(UtilsConfig::DELIMITER, $fieldValue); + } + + $output['paramsRaw'][$fieldName] = $fieldValue; $output['params'][$key] = $value; break;