From e0102ddbf055c3918be3ddd6dace10687a33acea Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 6 Jun 2022 20:03:20 -0700 Subject: [PATCH] Fixes #11093 Return true/false for custom fields/fieldsets required in API Signed-off-by: snipe --- app/Http/Transformers/CustomFieldsTransformer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Transformers/CustomFieldsTransformer.php b/app/Http/Transformers/CustomFieldsTransformer.php index 81135de13c..472a000002 100644 --- a/app/Http/Transformers/CustomFieldsTransformer.php +++ b/app/Http/Transformers/CustomFieldsTransformer.php @@ -46,7 +46,7 @@ class CustomFieldsTransformer 'field_values' => ($field->field_values) ? e($field->field_values) : null, 'field_values_array' => ($field->field_values) ? explode("\r\n", e($field->field_values)) : null, 'type' => e($field->element), - 'required' => $field->pivot ? $field->pivot->required : false, + 'required' => (($field->pivot) && ($field->pivot->required=='1')) ? true : false, 'created_at' => Helper::getFormattedDateObject($field->created_at, 'datetime'), 'updated_at' => Helper::getFormattedDateObject($field->updated_at, 'datetime'), ];