Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Adjust to latest symfony 2.1-DEV #621

merged 1 commit into from

5 participants


BC break with symfony 2.0!

The ArrayChoiceList is no longer part of symfony, it has been replaced by the SimpleChoiceList. Also options no longer contain the defaults in the getParent method of a type.

See also to explain the changes.


+1 fixes issue in sonata-user user group select

Issue #544
Issue #597


@rande you definitely need to start maintaining 2 branches if you want to continue improving the bundle for 2.0.x users (which is a good idea IMO). Keeping SAB incompatible with Symfony 2.1-dev is really an issue.


+1 on this. I was surprised there wasn't a branch 2.0.x already !


yeah EXACTLY ;D lol sry i was focusing on the 2.1 compatibility, so, why if there is a 2.0 tag, the master branch is not compliant with the ArrayChoiceList being updated to SimpleChoiceList. ^^


Oh, i get it, you just created the 2.0 tag, so your next move is to accept this pull request. I just understand this was fresh =D


@rande Tu pourrais merger, si possible, rapidement les PR pour rendre compatible avec la 2.1 stp Thomas ?

@rande rande merged commit 9ab4e8a into sonata-project:master
@ojkelly ojkelly referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 14, 2012
  1. @uwej711

    Adjust to latest symfony 2.1-DEV

    uwej711 committed
    See also to explain the changes.
    BC break with symfony 2.0
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 7 deletions.
  1. +5 −5 Form/ChoiceList/ModelChoiceList.php
  2. +2 −2 Form/Type/ModelType.php
10 Form/ChoiceList/ModelChoiceList.php
@@ -14,10 +14,10 @@
use Symfony\Component\Form\Util\PropertyPath;
use Symfony\Component\Form\Exception\FormException;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
-use Symfony\Component\Form\Extension\Core\ChoiceList\ArrayChoiceList;
+use Symfony\Component\Form\Extension\Core\ChoiceList\SimpleChoiceList;
use Sonata\AdminBundle\Model\ModelManagerInterface;
-class ModelChoiceList extends ArrayChoiceList
+class ModelChoiceList extends SimpleChoiceList
* @var \Sonata\AdminBundle\Model\ModelManagerInterface
@@ -86,6 +86,8 @@ public function __construct(ModelManagerInterface $modelManager, $class, $proper
$this->choices = $choices;
+ $this->load();
+ parent::__construct($this->choices);
@@ -109,8 +111,6 @@ public function __construct(ModelManagerInterface $modelManager, $class, $proper
protected function load()
- parent::load();
if (is_array($this->choices)) {
$entities = $this->choices;
} else if ($this->query) {
@@ -258,4 +258,4 @@ public function getClass()
return $this->class;
4 Form/Type/ModelType.php
@@ -69,11 +69,11 @@ public function getDefaultOptions(array $options)
public function getParent(array $options)
- return $options['parent'];
+ return isset($options['parent']) ? $options['parent'] : 'choice';
public function getName()
return 'sonata_type_model';
Something went wrong with that request. Please try again.