Skip to content

Commit 2353b5d

Browse files
author
Charlie
committed
adapt for symfony 2.7
1 parent ddc9574 commit 2353b5d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Form/Type/ChoiceTreeType.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ class ChoiceTreeType extends ChoiceType
3232
*/
3333
public function buildForm(FormBuilderInterface $builder, array $options)
3434
{
35-
$choiceList = $options['choice_list']->getAdaptedList();
35+
// for symfony 2.7
36+
$choiceList = method_exists($options['choice_list'], "getAdaptedList") ? $options['choice_list']->getAdaptedList(): $options['choice_list'];
3637
if (!$choiceList && !is_array($options['choices']) && !$options['choices'] instanceof \Traversable) {
3738
throw new LogicException('Either the option "choices" or "choice_list" must be set.');
3839
}

0 commit comments

Comments
 (0)