浏览代码

Fix wrong options merging in FormMapper::add()

lu4e3ar 13 年之前
父节点
当前提交
b81c1243d6
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Form/FormMapper.php

+ 1 - 1
Form/FormMapper.php

@@ -101,7 +101,7 @@ class FormMapper
         if ($name instanceof FormBuilder) {
             $this->formBuilder->add($name);
         } else {
-            $options = array_merge($options, $this->formContractor->getDefaultOptions($type, $fieldDescription));
+            $options = array_replace_recursive($this->formContractor->getDefaultOptions($type, $fieldDescription), $options);
 
             if (!isset($options['label'])) {
                 $options['label'] = $this->admin->getLabelTranslatorStrategy()->getLabel($fieldDescription->getName(), 'form', 'label');