Преглед на файлове

Fix #147 - accept empty array as value

Thomas Rabaix преди 14 години
родител
ревизия
d5473135e0
променени са 2 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 1 1
      Form/ChoiceList/ModelChoiceList.php
  2. 1 1
      Form/Type/ModelType.php

+ 1 - 1
Form/ChoiceList/ModelChoiceList.php

@@ -111,7 +111,7 @@ class ModelChoiceList extends ArrayChoiceList
     {
         parent::load();
 
-        if ($this->choices) {
+        if (is_array($this->choices)) {
             $entities = $this->choices;
         } else if ($this->query) {
             $entities = $this->modelManager->executeQuery($this->query);

+ 1 - 1
Form/Type/ModelType.php

@@ -45,7 +45,7 @@ class ModelType extends AbstractType
             'class'             => null,
             'property'          => null,
             'query'             => null,
-            'choices'           => array(),
+            'choices'           => null,
             'parent'            => 'choice',
             'preferred_choices' => array(),
             'field_description' => false,