diff --git a/lib/Models/Form.php b/lib/Models/Form.php index 8ec0afb8d3..f3235ec465 100644 --- a/lib/Models/Form.php +++ b/lib/Models/Form.php @@ -59,7 +59,9 @@ class Form extends Model { && !empty($field['body']) ) { $nestedFields = $this->getFieldList($field['body']); - $fields = array_merge($fields, $nestedFields); + if ($nestedFields) { + $fields = array_merge($fields, $nestedFields); + } continue; } diff --git a/tests/integration/Models/FormTest.php b/tests/integration/Models/FormTest.php index a58ecf9fb8..9d2a953c52 100644 --- a/tests/integration/Models/FormTest.php +++ b/tests/integration/Models/FormTest.php @@ -117,6 +117,15 @@ class FormTest extends \MailPoetTest { ], ], ], + [ + 'type' => 'column', + 'body' => [ + [ + 'type' => 'divider', + 'id' => 'divider', + ], + ], + ], ], ], [