8000 bug #53381 [Form] Fix assigning data in `PostSetDataEvent` and `PostS… · symfony/symfony@2e73037 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2e73037

Browse files
committed
bug #53381 [Form] Fix assigning data in PostSetDataEvent and PostSubmitEvent (fancyweb)
This PR was merged into the 6.4 branch. Discussion ---------- [Form] Fix assigning data in `PostSetDataEvent` and `PostSubmitEvent` | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | #53364 | License | MIT Ref #51043 where we changed the behavior on 6.4 since we don't assign the data property anymore. cc `@HeahDude` Commits ------- 61d71c4 [Form] Fix assigning data in PostSetDataEvent and PostSubmitEvent
2 parents aa08fc1 + 61d71c4 commit 2e73037

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/Symfony/Component/Form/Event/PostSetDataEvent.php

Lines changed: 1 addition & 1 deletion
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
}

src/Symfony/Component/Form/Event/PostSubmitEvent.php

Lines changed: 1 addition & 0 deletions
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)
0