From c19baf8bd5c97b84be35a8b7fb3003b3ddbba268 Mon Sep 17 00:00:00 2001 From: George Date: Sun, 10 Apr 2016 19:30:16 +0300 Subject: [PATCH] Update AjaxEntityChoiceList.php Fix compatibility with SF > 2.6 --- Form/Doctrine/ChoiceList/AjaxEntityChoiceList.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Form/Doctrine/ChoiceList/AjaxEntityChoiceList.php b/Form/Doctrine/ChoiceList/AjaxEntityChoiceList.php index 2e0ec2e2..3698e913 100644 --- a/Form/Doctrine/ChoiceList/AjaxEntityChoiceList.php +++ b/Form/Doctrine/ChoiceList/AjaxEntityChoiceList.php @@ -11,6 +11,7 @@ namespace Genemu\Bundle\FormBundle\Form\Doctrine\ChoiceList; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Bridge\Doctrine\Form\ChoiceList\EntityChoiceList; use Symfony\Component\PropertyAccess\PropertyPath; use Symfony\Bridge\Doctrine\Form\ChoiceList\ORMQueryBuilderLoader; @@ -60,7 +61,11 @@ public function __construct(ObjectManager $em, $class, $property = null, $qb = n protected function load() { if (!$this->ajax) { - parent::load(); + //TODO: load is a private method and EntityChoiceList is depricated use DoctrineChoiceLoader + if (Kernel::MAJOR_VERSION == 2 AND Kernel::MINOR_VERSION < 7) + { + parent::load(); + } } }