-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[#2963] Disabling validation corectly #3346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
piorek
commented
Dec 15, 2013
Q | A |
---|---|
Doc fix? | yes |
New docs? | no |
Applies to | 2.3+ |
Fixed tickets | #2963 |
@@ -479,12 +479,10 @@ Disabling Validation | |||
.. versionadded:: 2.3 | |||
The ability to set ``validation_groups`` to false was added in Symfony 2.3, | |||
although setting it to an empty array achieved the same result in previous | |||
versions. | |||
versions. Please note that empty array doesn't work anymore. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then we should remove that sentence from this note
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what would be the the correct form of that sentences?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just remove everything after the comma on lin 480 and replace the comma by a dot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Thank you! It's really lovely too see new people adding articles! (and it's great to see someone follows our standard at the first time they submit 😉 ) Don't be shocked of the many comments. If you don't understand something or want some more information, you can just ask for it. At last, what about adding a link to a section which talks a bit more about Form Events? |
|
||
.. _cookbook-dynamic-form-modification-supressing-form-validation: | ||
|
||
Supressing Form Validation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo supressing -> suppressing
.. caution:: | ||
|
||
By doing this, you can disable something more than just form validation, | ||
because ``POST_SUBMIT`` event can be used for something else. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you forgot to include "the" before "POST_SUBMIT" and "too" after "else"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
👍 |
Hope it's all ok now. It was only shocking at the beginning. |
It's perfect now, when @weaverryan has time, he'll merge it. Thank you for documenting this! |
{ | ||
$builder->addEventListener(FormEvents::POST_SUBMIT, function($event) { | ||
$event->stopPropagation(); | ||
}, /* priority higher than ValidationListener */ 900); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this inline comment a bit weird. What do you whink about putting it just above the statement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ggam I don't know.
I think that inline comment is good there, because it keeps context. If we put it above statement it will be little off.
But if we have more people that will think like you i can change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A better choice then will be to put this at the end of the line after the semi colon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 |
{ | ||
$builder->addEventListener(FormEvents::POST_SUBMIT, function($event) { | ||
$event->stopPropagation(); | ||
}, 900); /* priority higher than ValidationListener */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better this way, but what about Always set higher priority than ValidationListener
? Also, is there any policy regarding /* ... */
vs // ...
comments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set a higher
And yes, maybe using // is nicer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 |
[#2963] Disabling validation corectly
Great work Łukasz! Thanks for doing this and going through all of the tweaks with us - I'm very happy with the result! Cheers! |