From 61d71c4a79b966d2f11bedb8287d50b94023a5dd Mon Sep 17 00:00:00 2001 From: Thomas Calvet Date: Wed, 3 Jan 2024 09:34:12 +0100 Subject: [PATCH] [Form] Fix assigning data in PostSetDataEvent and PostSubmitEvent --- src/Symfony/Component/Form/Event/PostSetDataEvent.php | 2 +- src/Symfony/Component/Form/Event/PostSubmitEvent.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Form/Event/PostSetDataEvent.php b/src/Symfony/Component/Form/Event/PostSetDataEvent.php index b42012d68276f..7d551f8b526ac 100644 --- a/src/Symfony/Component/Form/Event/PostSetDataEvent.php +++ b/src/Symfony/Component/Form/Event/PostSetDataEvent.php @@ -11,7 +11,6 @@ namespace Symfony\Component\Form\Event; -use Symfony\Component\Form\Exception\BadMethodCallException; use Symfony\Component\Form\FormEvent; /** @@ -29,5 +28,6 @@ public function setData(mixed $data): void { trigger_deprecation('symfony/form', '6.4', 'Calling "%s()" will throw an exception as of 7.0, listen to "form.pre_set_data" instead.', __METHOD__); // throw new BadMethodCallException('Form data cannot be changed during "form.post_set_data", you should use "form.pre_set_data" instead.'); + parent::setData($data); } } diff --git a/src/Symfony/Component/Form/Event/PostSubmitEvent.php b/src/Symfony/Component/Form/Event/PostSubmitEvent.php index b7fb10176a9d1..5ce6d8ecb7f83 100644 --- a/src/Symfony/Component/Form/Event/PostSubmitEvent.php +++ b/src/Symfony/Component/Form/Event/PostSubmitEvent.php @@ -28,5 +28,6 @@ public function setData(mixed $data): void { trigger_deprecation('symfony/form', '6.4', 'Calling "%s()" will throw an exception as of 7.0, listen to "form.pre_submit" or "form.submit" instead.', __METHOD__); // throw new BadMethodCallException('Form data cannot be changed during "form.post_submit", you should use "form.pre_submit" or "form.submit" instead.'); + parent::setData($data); } }