The error occurs when I nest multiple subform fields.
I wrote the following code to fix the issue:
// Flatten the value if it is an array (list, checkboxes, etc.), independent of render_values
if (is_array($subfield->value)) {
if (!empty($subfield->value)) {
$new_value = "";
array_walk_recursive($subfield->value, function ($value) use (&$new_value) {
$new_value .= $value . " ";
});
$subfield->value = trim($new_value);
} else {
$subfield->value = implode(' ', $subfield->value);
}
}
| Labels |
Removed:
?
|
||
| Labels |
Added:
No Code Attached Yet
|
||
@romeolandry please provide more information.
What error occur?
How did you create subform, using Content Custom field or with XML in your extension?
With the fields example.
| Labels |
Added:
Information Required
|
||
@Fedik As it is about subforms: Could you check this issue? I'm not sure if the proposed solution is right.