Pass through enableDefaults config to nested forms

This should allow default values to be used in nested form fields within new repeater items.

Fixes #4380.
This commit is contained in:
Ben Thomson 2019-07-23 11:20:18 +08:00
parent 36c69a063b
commit a7bc442df5
No known key found for this signature in database
GPG Key ID: B2BAFACC5ED68F87

View File

@ -49,6 +49,10 @@ class NestedForm extends FormWidgetBase
$config->arrayName = $this->getFieldName();
$config->isNested = true;
if (object_get($this->getParentForm()->config, 'enableDefaults') === true) {
$config->enableDefaults = true;
}
$widget = $this->makeWidget(Form::class, $config);
$widget->bindToController();