Skip to content

Commit 748adbd

Browse files
committed
[Form] Fix assigning data in PostSetDataEvent and PostSubmitEvent
1 parent 4c4ac29 commit 748adbd

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Event/PostSetDataEvent.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\Form\Event;
1313

14-
use Symfony\Component\Form\Exception\BadMethodCallException;
1514
use Symfony\Component\Form\FormEvent;
1615

1716
/**
@@ -29,5 +28,6 @@ public function setData(mixed $data): void
2928
{
3029
trigger_deprecation('symfony/form', '6.4', 'Calling "%s()" will throw an exception as of 7.0, listen to "form.pre_set_data" instead.', __METHOD__);
3130
// throw new BadMethodCallException('Form data cannot be changed during "form.post_set_data", you should use "form.pre_set_data" instead.');
31+
parent::setData($data);
3232
}
3333
}

Event/PostSubmitEvent.php

+1
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@ public function setData(mixed $data): void
2828
{
2929
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__);
3030
// throw new BadMethodCallException('Form data cannot be changed during "form.post_submit", you should use "form.pre_submit" or "form.submit" instead.');
31+
parent::setData($data);
3132
}
3233
}

0 commit comments

Comments
 (0)