Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
Fix the definition of customizing form's global errors.#3543
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
cookbook/form/form_customization.rst Outdated
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'm not sure which is more correct for thecompound - attribute or varaible.
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'd add also an example block as in#3542. This way it's easier for new comers understand what to do without searching for something that simply does not exist. Wdyt?
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'm not sure if I understand you correctly. There is an example block below this line. Do you think that anything else should be added?
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.
AH! Shame on me :) Just replied to your comment and didn't see the rest. Well looks good to me!
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'd use "variable" - consistent with our conversation on "form variables" elsewhere.
Also, how about a small sentence about compound? Something like:
If the ``compound`` variable is ``true``, it means that what's being rendered is a collection of fields (e.g. a whole form), and not just an individual field.Feel free to work on the wording - that's tough to get clear :).
mtrojanowski commentedFeb 5, 2014
While inspecting this issue I started to wander if this fragment is adequate (same file, line 773): The first sentence suggests that you can customize the errors for each field type separately, but I don't think this is the case. Can anyone confirm if it's possible or is the sentence a bit misleading? |
stof commentedFeb 5, 2014
@mtrojanowski you can. It works exactly the same way than customizing the widget of a field (except that the block name ends with |
mtrojanowski commentedFeb 5, 2014
@stof thanks. It's good to know. Maybe it's worth mentioning it in the docs implicitly. Now I think it's a bit to vague. I'll think of something and add to the PR. |
mtrojanowski commentedFeb 5, 2014
Added the note on how to customize errors for different field types. In fact I found this information in a sidebar a few sections above ("Knowing which block to customize"). Nevertheless I think it's better that all the information about the error customization is in one place (even if some of the information is doubled in the article). |
cookbook/form/form_customization.rst Outdated
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.
What about the else? We're not trying to customize the else case here, but of course without it, non-compound errors won't show up - so we'll need something :)
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.
btw,@mtrojanowski happy to see you around here lately :)
mtrojanowski commentedFeb 20, 2014
Took me a while but finally fixed the code according to the comments :) |
cookbook/form/form_customization.rst Outdated
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 added the part about thecompound var as a tip. Or would you rather leave it as a regular sentence in the text?
@weaverryan@wouterj
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 would put it in a regular sentence
mtrojanowski commentedMar 16, 2014
Applied the changes proposed by Wouter. As for the colons and semicolons in PHP templates I understand that I don't have to change anything there, right? |
weaverryan commentedMar 18, 2014
Woot, thanks Michał! :) |
…rojanowski)This PR was merged into the 2.3 branch.Discussion----------Fix the definition of customizing form's global errors.The documentation for customizing global errors was actually still referring to the way it was done in 2.0. (where two different blocks were used: `field_errors` and `form_errors`). Since 2.1. only `form_errors` is used and errors are differentiated using the `compound` variable (set to `true` for form errors).| Q | A| ------------- | ---| Doc fix? | yes| New docs? | no| Applies to | 2.3+| Fixed tickets |#3542Commits-------6f6fcca Applied some changes according to comments.e3b20d8 Minor rewording. Added tip about meaning of `compound` var and expanded the example code to contain `else` statements.1e278c4 Added note about customizing errors for different field types.236d06b Fix the definition of customizing form's global errors.
mtrojanowski commentedMar 18, 2014
Always a pleasure :) |
The documentation for customizing global errors was actually still referring to the way it was done in 2.0. (where two different blocks were used:
field_errorsandform_errors). Since 2.1. onlyform_errorsis used and errors are differentiated using thecompoundvariable (set totruefor form errors).