From 2ad82e8cc137c6765f4c6c30bd58f3b872c814bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Sun, 23 Jul 2023 00:00:23 +0200 Subject: [PATCH] Fix loading data for customfield with new templating engine --- .../DataFixtures/ORM/LoadCustomFields.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php index 78d8f886b..24514c70a 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php @@ -21,11 +21,13 @@ use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\PersonBundle\Entity\Person; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\OrderedFixtureInterface; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\Persistence\ObjectManager; use RuntimeException; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Contracts\Translation\TranslatorInterface; +use Twig\Environment; class LoadCustomFields extends AbstractFixture implements ContainerAwareInterface, @@ -78,7 +80,7 @@ class LoadCustomFields extends AbstractFixture implements private function createCustomFieldChoice() { return new CustomFieldChoice( - $this->container->get('templating'), + $this->container->get(Environment::class), $this->translatableStringHelper ); } @@ -86,14 +88,14 @@ class LoadCustomFields extends AbstractFixture implements private function createCustomFieldText() { return new CustomFieldText( - $this->container->get('templating'), + $this->container->get(Environment::class), $this->translatableStringHelper ); } private function loadData(ObjectManager $manager) { - $personIds = $this->container->get('doctrine.orm.entity_manager') + $personIds = $this->container->get(EntityManagerInterface::class) ->createQuery('SELECT person.id FROM ChillPersonBundle:Person person') ->getScalarResult();