fixes enable Defaults on repeater (#4129)

Credit to @panakour
This commit is contained in:
Panagiotis Koursaris 2019-02-11 17:54:55 +02:00 committed by Luke Towers
parent 10d97d515f
commit bb0a23f54c
1 changed files with 3 additions and 1 deletions

View File

@ -284,7 +284,9 @@ class Repeater extends FormWidgetBase
$config->alias = $this->alias . 'Form'.$index;
$config->arrayName = $this->getFieldName().'['.$index.']';
$config->isNested = true;
$config->enableDefaults = self::$onAddItemCalled;
if (self::$onAddItemCalled || $this->minItems > 0) {
$config->enableDefaults = true;
}
$widget = $this->makeWidget('Backend\Widgets\Form', $config);
$widget->bindToController();