Explorar o código

Fix label when working with FormBuilder

Thomas Rabaix %!s(int64=13) %!d(string=hai) anos
pai
achega
0bf6bb56d3
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      Form/FormMapper.php

+ 3 - 1
Form/FormMapper.php

@@ -80,8 +80,10 @@ class FormMapper
             $this->with($this->admin->getLabel());
         }
 
+        $label = $name instanceof FormBuilder ? $name->getName() : $name;
+
         $formGroups = $this->admin->getFormGroups();
-        $formGroups[$this->currentGroup]['fields'][$name] = $name;
+        $formGroups[$this->currentGroup]['fields'][$label] = $label;
         $this->admin->setFormGroups($formGroups);
 
         if (!isset($fieldDescriptionOptions['type']) && is_string($type)) {