Skip to content
Snippets Groups Projects
Commit 211e0891 authored by Lucas García's avatar Lucas García
Browse files

fix: allow empty fileupload fields

parent 1142fc36
No related branches found
No related tags found
No related merge requests found
......@@ -56,8 +56,12 @@ function wpct_crm_forms_parse_form_entry($entry, $form)
function wpct_crm_forms_format_value($value, $field, $input = null)
{
if ($field->type === 'fileupload') {
return implode(',', json_decode($value));
try {
if ($field->type === 'fileupload' && $value && is_string($value)) {
return implode(',', json_decode($value));
}
} catch (Exception $e) {
// do nothing
}
return $value;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment