Skip to content

[#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

Merged
merged 6 commits into from
Dec 26, 2013
Merged

[#2963] Disabling validation corectly #3346

merged 6 commits into from
Dec 26, 2013

Conversation

piorek
Copy link
Contributor

@piorek 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.
Copy link
Member

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

Copy link
Contributor Author

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?

Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@wouterj
Copy link
Member

wouterj commented Dec 15, 2013

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
Copy link
Member

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.
Copy link
Member

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"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@wouterj
Copy link
Member

wouterj commented Dec 15, 2013

👍

@piorek
Copy link
Contributor Author

piorek commented Dec 15, 2013

Hope it's all ok now. It was only shocking at the beginning.

@wouterj
Copy link
Member

wouterj commented Dec 15, 2013

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);
Copy link

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?

Copy link
Contributor Author

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.

Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ggam I changed it according to @wouterj suggestion. Hope it's better now.

@xabbuh
Copy link
Member

xabbuh commented Dec 15, 2013

👍

{
$builder->addEventListener(FormEvents::POST_SUBMIT, function($event) {
$event->stopPropagation();
}, 900); /* priority higher than ValidationListener */
Copy link

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?

Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ggam
Copy link

ggam commented Dec 15, 2013

👍

weaverryan added a commit that referenced this pull request Dec 26, 2013
[#2963] Disabling validation corectly
@weaverryan weaverryan merged commit d6edcdf into symfony:2.3 Dec 26, 2013
weaverryan added a commit that referenced this pull request Dec 26, 2013
@weaverryan
Copy link
Member

Great work Łukasz! Thanks for doing this and going through all of the tweaks with us - I'm very happy with the result!

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants