From f48e197e0ba36b80e3015ced23b4ecec6c02c453 Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 30 Jun 2022 07:29:33 +0200 Subject: [PATCH 1/3] [main] fix deprecations for Export/PickCenterType --- .../ChillMainBundle/Form/Type/Export/PickCenterType.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php b/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php index 2fe5ff8f2..1c6c01f72 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() + $export->requiredRole()->__toString() ); $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( From c76f2a81c9a4b915c958d1803fafaf95bd19560b Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 30 Jun 2022 07:37:27 +0200 Subject: [PATCH 2/3] [main] cast uniqid arg to string in ExportController --- src/Bundle/ChillMainBundle/Controller/ExportController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); From 31e1bfdf802fe6acd6ac5571eaef9c77643c91b6 Mon Sep 17 00:00:00 2001 From: nobohan Date: Mon, 4 Jul 2022 16:19:03 +0200 Subject: [PATCH 3/3] export: cast role as string in PickCenterType --- src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php b/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php index 1c6c01f72..9c36d452f 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php @@ -80,7 +80,7 @@ class PickCenterType extends AbstractType $export = $this->exportManager->getExport($options['export_alias']); $centers = $this->authorizationHelper->getReachableCenters( $this->user, - $export->requiredRole()->__toString() + (string) $export->requiredRole() ); $builder->add(self::CENTERS_IDENTIFIERS, EntityType::class, [