Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4c414d8

Browse filesBrowse files
committed
feature #24631 [Form] Fix FormEvents::* constant and value matching (yceruto, javiereguiluz)
This PR was merged into the 4.0-dev branch. Discussion ---------- [Form] Fix FormEvents::* constant and value matching | Q | A | ------------- | --- | Branch? | 4.0 | Bug fix? | no | New feature? | no | BC breaks? | yes (ppl rely on const value directly, very weird) | Deprecations? | no | Tests pass? | yes | Fixed tickets | #24615 | License | MIT | Doc PR | - > #24615 (comment) by @stof: Yeah, I think we could change this in 4.0 without a big impact (btw, I think our BC policy even allows it for this case). There is one case where people will use the event name rather than the constant: the kernel.event_listener tag (and recent versions can even use the constant in YAML files). But this won't be the case for this event, as form events are not dispatched in the main dispatcher anyway. Commits ------- 944931a Minor reword 0ee856a Update UPGRADE-4.0.md 0fc2282 fix the constant value to be consistent with the name
2 parents 10ab3a6 + 944931a commit 4c414d8
Copy full SHA for 4c414d8

File tree

Expand file treeCollapse file tree

2 files changed

+7
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+7
-3
lines changed

‎UPGRADE-4.0.md

Copy file name to clipboardExpand all lines: UPGRADE-4.0.md
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,10 @@ Finder
226226
Form
227227
----
228228

229+
* The values of the `FormEvents::*` constants have been updated to match the
230+
constant names. You should only update your application if you relied on the
231+
constant values instead of their names.
232+
229233
* The `choices_as_values` option of the `ChoiceType` has been removed.
230234

231235
* Support for data objects that implements both `Traversable` and

‎src/Symfony/Component/Form/FormEvents.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/FormEvents.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ final class FormEvents
3131
*
3232
* @Event("Symfony\Component\Form\FormEvent")
3333
*/
34-
const PRE_SUBMIT = 'form.pre_bind';
34+
const PRE_SUBMIT = 'form.pre_submit';
3535

3636
/**
3737
* The SUBMIT event is dispatched just before the Form::submit() method
@@ -41,7 +41,7 @@ final class FormEvents
4141
*
4242
* @Event("Symfony\Component\Form\FormEvent")
4343
*/
44-
const SUBMIT = 'form.bind';
44+
const SUBMIT = 'form.submit';
4545

4646
/**
4747
* The FormEvents::POST_SUBMIT event is dispatched after the Form::submit()
@@ -51,7 +51,7 @@ final class FormEvents
5151
*
5252
* @Event("Symfony\Component\Form\FormEvent")
5353
*/
54-
const POST_SUBMIT = 'form.post_bind';
54+
const POST_SUBMIT = 'form.post_submit';
5555

5656
/**
5757
* The FormEvents::PRE_SET_DATA event is dispatched at the beginning of the Form::setData() method.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.