Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

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

Merged
weaverryan merged 4 commits intosymfony:2.3frommtrojanowski:customize-form-errors
Mar 18, 2014

Conversation

@mtrojanowski
Copy link
Contributor

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 andform_errors). Since 2.1. onlyform_errors is used and errors are differentiated using thecompound variable (set totrue for form errors).

QA
Doc fix?yes
New docs?no
Applies to2.3+
Fixed tickets#3542

Copy link
ContributorAuthor

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.

Copy link
Contributor

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?

Copy link
ContributorAuthor

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?

Copy link
Contributor

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!

Copy link
Member

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

While inspecting this issue I started to wander if this fragment is adequate (same file, line 773):

  You can also customize the error output for just one specific field type.  For example, certain errors that are more global to your form (i.e. not specific  to just one field) are rendered separately, usually at the top of your form:

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

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_errors instead of_widget)

@mtrojanowski
Copy link
ContributorAuthor

@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
Copy link
ContributorAuthor

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).

Copy link
Member

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 :)

Copy link
Member

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

Took me a while but finally fixed the code according to the comments :)

Copy link
ContributorAuthor

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

Copy link
Member

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

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

Woot, thanks Michał! :)

weaverryan added a commit that referenced this pull requestMar 18, 2014
…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.
@weaverryanweaverryan merged commit6f6fcca intosymfony:2.3Mar 18, 2014
@mtrojanowski
Copy link
ContributorAuthor

Always a pleasure :)

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@mtrojanowski@stof@weaverryan@dlondero@wouterj@xabbuh

[8]ページ先頭

©2009-2025 Movatter.jp