diff --git a/src/Bundle/ChillMainBundle/Controller/ExportController.php b/src/Bundle/ChillMainBundle/Controller/ExportController.php index bc3f994a7..5dcd158f6 100644 --- a/src/Bundle/ChillMainBundle/Controller/ExportController.php +++ b/src/Bundle/ChillMainBundle/Controller/ExportController.php @@ -405,7 +405,7 @@ class ExportController extends AbstractController 'alias' => $alias, ]; unset($parameters['_token']); - $key = md5(uniqid(mt_rand(), false)); + $key = md5(uniqid((string) mt_rand(), false)); $this->redis->setEx($key, 3600, serialize($parameters)); diff --git a/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php b/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php index 2fe5ff8f2..9c36d452f 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php @@ -75,14 +75,16 @@ class PickCenterType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { + + $export = $this->exportManager->getExport($options['export_alias']); $centers = $this->authorizationHelper->getReachableCenters( $this->user, - $export->requiredRole() + (string) $export->requiredRole() ); $builder->add(self::CENTERS_IDENTIFIERS, EntityType::class, [ - 'class' => 'ChillMainBundle:Center', + 'class' => Center::class, 'query_builder' => static function (EntityRepository $er) use ($centers) { $qb = $er->createQueryBuilder('c'); $ids = array_map(