From 36f2275a560b8d04c8bfe1e1c2766c3f4db5588d Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 25 Jun 2024 17:22:48 +0200 Subject: [PATCH] Delete overriding of generateTemplateParameters method This method was requiring a person_id to be set, which was\ not the case here so it threw an error. Using the method\ already available in CRUDController works fine, seems to be\ no need to override it. --- .../Controller/EntityPersonCRUDController.php | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/CRUD/Controller/EntityPersonCRUDController.php b/src/Bundle/ChillPersonBundle/CRUD/Controller/EntityPersonCRUDController.php index 6980e84b1..760b7ee9d 100644 --- a/src/Bundle/ChillPersonBundle/CRUD/Controller/EntityPersonCRUDController.php +++ b/src/Bundle/ChillPersonBundle/CRUD/Controller/EntityPersonCRUDController.php @@ -66,25 +66,6 @@ class EntityPersonCRUDController extends CRUDController return $qb; } - /** - * @throws \Exception - */ - protected function generateTemplateParameter(string $action, $entity, Request $request, array $defaultTemplateParameters = []): array - { - $person = $this->getPerson($request); - - if (null === $person) { - throw new \Exception('the `person_id` parameter is not set in the query. You should set it or override the current method to allow another behaviour: '.__METHOD__); - } - - return parent::generateTemplateParameter( - $action, - $entity, - $request, - \array_merge(['person' => $person], $defaultTemplateParameters) - ); - } - /** * Extract the person from the request. *