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

[Form] Forms now don't create empty objects anymore if they are empty and not required#3257

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
fabpot merged 1 commit intosymfony:masterfromwebmozart:issue2861
Feb 2, 2012

Conversation

@webmozart
Copy link
Contributor

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets:#2861
Todo: -

Travis Build Status

If a form (or a nested form) is left completely empty upon submission and is not required, no new data object will be generated anymore. Instead, the form returns null as data.

…etely empty and not required. The empty data for these forms is null.
Copy link
Contributor

Choose a reason for hiding this comment

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

typo? twoemptys

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

No typo. It's bound empty (without data) while the form has no (empty) data. It's slightly confusing, I agree.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. The other test names also confused me. I think it would be more clear withon preposition.
SotestBindEmptyDataOnEmptyDataCreatesNoObjectIfNotRequired andtestBindOnEmptyDataCreatesObjectIfClassAvailable.

fabpot added a commit that referenced this pull requestFeb 2, 2012
Commits-------bd461e2 [Form] Forms now don't create empty objects anymore if they are completely empty and not required. The empty data for these forms is null.Discussion----------[Form] Forms now don't create empty objects anymore if they are empty and not requiredBug fix: yesFeature addition: noBackwards compatibility break: noSymfony2 tests pass: yesFixes the following tickets:#2861Todo: -![Travis Build Status](https://secure.travis-ci.org/bschussek/symfony.png?branch=issue2861)If a form (or a nested form) is left completely empty upon submission and is not required, no new data object will be generated anymore. Instead, the form returns null as data.
@fabpotfabpot merged commitbd461e2 intosymfony:masterFeb 2, 2012
fabpot added a commit that referenced this pull requestDec 17, 2013
…ata handling of collections (peterrehm)This PR was squashed before being merged into the 2.5-dev branch (closes#9773).Discussion----------[Form] Added delete_empty option to allow proper emptyData handling of collections| Q             | A| ------------- | ---| Bug fix?      | yes| New feature?  | yes/no?| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#9375| License       | MIT| Doc PR        |symfony/symfony-docs#3338This PR adresses the issue that if you have a form collection with the option required => false and you submit an empty collection so you will get a ArrayCollection that contains en element with the value null.This behaviour was introduced with the following changes from#3257In addition to the above mentioned ticket there is also a description about the same issue here:http://stackoverflow.com/questions/19474872/symfony2-form-collection-allow-add-and-allow-delete-null-error-silexWith the changes of this PR the new option empty_data is introduced. With this option you will be able to ignore/delete such empty collections, so they will neither be validated nor appear as empty field in the result.The option will remove/ignore such empty collections if you add them newly and if allow_add is enabled andremoves such empty collections only if allow_delete is enabled.With setting required and empty_data accordingly it will be now flexible to customize to the outcome you want to achieve.Thanks to @bschussek for the great work together - We have to discuss how to name this option so if deleteor ignore is the appropriate name.Commits-------8bdb7a0 [Form] Added delete_empty option to allow proper emptyData handling of collections
fabpot added a commit to symfony/form that referenced this pull requestDec 17, 2013
…ata handling of collections (peterrehm)This PR was squashed before being merged into the 2.5-dev branch (closes #9773).Discussion----------[Form] Added delete_empty option to allow proper emptyData handling of collections| Q             | A| ------------- | ---| Bug fix?      | yes| New feature?  | yes/no?| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | #9375| License       | MIT| Doc PR        |symfony/symfony-docs#3338This PR adresses the issue that if you have a form collection with the option required => false and you submit an empty collection so you will get a ArrayCollection that contains en element with the value null.This behaviour was introduced with the following changes fromsymfony/symfony#3257In addition to the above mentioned ticket there is also a description about the same issue here:http://stackoverflow.com/questions/19474872/symfony2-form-collection-allow-add-and-allow-delete-null-error-silexWith the changes of this PR the new option empty_data is introduced. With this option you will be able to ignore/delete such empty collections, so they will neither be validated nor appear as empty field in the result.The option will remove/ignore such empty collections if you add them newly and if allow_add is enabled andremoves such empty collections only if allow_delete is enabled.With setting required and empty_data accordingly it will be now flexible to customize to the outcome you want to achieve.Thanks to @bschussek for the great work together - We have to discuss how to name this option so if deleteor ignore is the appropriate name.Commits-------8bdb7a0 [Form] Added delete_empty option to allow proper emptyData handling of collections
fabpot added a commit to symfony/form that referenced this pull requestMar 30, 2014
…ata handling of collections (peterrehm)This PR was squashed before being merged into the 2.5-dev branch (closes #9773).Discussion----------[Form] Added delete_empty option to allow proper emptyData handling of collections| Q             | A| ------------- | ---| Bug fix?      | yes| New feature?  | yes/no?| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | #9375| License       | MIT| Doc PR        |symfony/symfony-docs#3338This PR adresses the issue that if you have a form collection with the option required => false and you submit an empty collection so you will get a ArrayCollection that contains en element with the value null.This behaviour was introduced with the following changes fromsymfony/symfony#3257In addition to the above mentioned ticket there is also a description about the same issue here:http://stackoverflow.com/questions/19474872/symfony2-form-collection-allow-add-and-allow-delete-null-error-silexWith the changes of this PR the new option empty_data is introduced. With this option you will be able to ignore/delete such empty collections, so they will neither be validated nor appear as empty field in the result.The option will remove/ignore such empty collections if you add them newly and if allow_add is enabled andremoves such empty collections only if allow_delete is enabled.With setting required and empty_data accordingly it will be now flexible to customize to the outcome you want to achieve.Thanks to @bschussek for the great work together - We have to discuss how to name this option so if deleteor ignore is the appropriate name.Commits-------8bdb7a0 [Form] Added delete_empty option to allow proper emptyData handling of collections
fabpot added a commit to symfony/form that referenced this pull requestMay 23, 2014
…ata handling of collections (peterrehm)This PR was squashed before being merged into the 2.5-dev branch (closes #9773).Discussion----------[Form] Added delete_empty option to allow proper emptyData handling of collections| Q             | A| ------------- | ---| Bug fix?      | yes| New feature?  | yes/no?| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | #9375| License       | MIT| Doc PR        |symfony/symfony-docs#3338This PR adresses the issue that if you have a form collection with the option required => false and you submit an empty collection so you will get a ArrayCollection that contains en element with the value null.This behaviour was introduced with the following changes fromsymfony/symfony#3257In addition to the above mentioned ticket there is also a description about the same issue here:http://stackoverflow.com/questions/19474872/symfony2-form-collection-allow-add-and-allow-delete-null-error-silexWith the changes of this PR the new option empty_data is introduced. With this option you will be able to ignore/delete such empty collections, so they will neither be validated nor appear as empty field in the result.The option will remove/ignore such empty collections if you add them newly and if allow_add is enabled andremoves such empty collections only if allow_delete is enabled.With setting required and empty_data accordingly it will be now flexible to customize to the outcome you want to achieve.Thanks to @bschussek for the great work together - We have to discuss how to name this option so if deleteor ignore is the appropriate name.Commits-------8bdb7a0 [Form] Added delete_empty option to allow proper emptyData handling of collections
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.

3 participants

@webmozart@Tobion@fabpot

[8]ページ先頭

©2009-2025 Movatter.jp