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] Fixed empty data for compound date types#29182

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

Conversation

@HeahDude
Copy link
Contributor

QA
Branch?2.8
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#4715
LicenseMIT
Doc PR~

@HeahDudeHeahDudeforce-pushed thefix-date-empty-data-compound branch fromd53e21a to9bab1e8CompareNovember 11, 2018 22:32
@nicolas-grekasnicolas-grekas added this to the2.8 milestoneNov 12, 2018
@HeahDude
Copy link
ContributorAuthor

To give more context,https://github.com/symfony/symfony/pull/29179/files#diff-1c1084613d7579bc9e39092ac95364f9R1020 is the test revealing the inconsistency prior to fix compound cases in this PR.

@nicolas-grekas
Copy link
Member

Thank you@HeahDude.

@nicolas-grekasnicolas-grekas merged commit9bab1e8 intosymfony:2.8Nov 15, 2018
nicolas-grekas added a commit that referenced this pull requestNov 15, 2018
This PR was merged into the 2.8 branch.Discussion----------[Form] Fixed empty data for compound date types| Q             | A| ------------- | ---| Branch?       | 2.8| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#4715| License       | MIT| Doc PR        | ~Commits-------9bab1e8 [Form] Fixed empty data for compound date types
@HeahDudeHeahDude deleted the fix-date-empty-data-compound branchNovember 15, 2018 17:14
@fabpotfabpot mentioned this pull requestNov 16, 2018
nicolas-grekas added a commit that referenced this pull requestNov 20, 2018
This PR was merged into the 3.4 branch.Discussion----------[Form] Fixed empty data for compound date interval| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#4715 (continuation)| License       | MIT| Doc PR        | ~Following#29182, since this type has been introduced in Symfony 3 but with the same limitation explained in#4715.So for consistency this needs to be fixed here as well.Commits-------38a2abc [Form] Fixed empty data for compound date interval
This was referencedNov 26, 2018
'data_class' =>null,
'compound' =>$compound,
'empty_data' =>function (Options$options) {
return$options['compound'] ?array() :'';
Copy link

Choose a reason for hiding this comment

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

Hi@nicolas-grekas ,
Could you explain, why empty data is empty string instead of null as it was before?

Copy link

Choose a reason for hiding this comment

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

We are usingDateTimeToRfc3339Transformer, and it's expecting null as an empty value, otherwise throws an exception, and probably the same issue will be withDateTimeToLocalizedStringTransformer

Copy link
Member

Choose a reason for hiding this comment

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

empty_data is in the view format. This value should not be passed totransform() but toreverseTransform(). Can you please open a new issue with fine steps that allow to reproduce if you think you found a bug?

Copy link

@anytanytJan 4, 2019
edited
Loading

Choose a reason for hiding this comment

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

Hm, based on examples from thedocumentation and according to thecode I thoughtempty_data is a model format, not view, as it could benew $data_class().

Need to investigate then.
Thank you for the fast response!

xabbuh reacted with thumbs up emoji
fabpot added a commit that referenced this pull requestFeb 3, 2020
…/Time form types (yceruto)This PR was merged into the 3.4 branch.Discussion----------[Form] Fix handling of empty_data's \Closure value in Date/Time form types| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       |Fix#33188| License       | MIT| Doc PR        | -Basically this would solve the posibility to pass a `\Closure` to the `empty_data` option for Date/Time form types.>https://symfony.com/doc/current/reference/forms/types/form.html#empty-data> If a form is compound, you can set empty_data as an array, object or **closure**. See the [How to Configure empty Data](https://symfony.com/doc/current/form/use_empty_data.html) for a Form Class article for more details about these options.Also related to#29182Commits-------4939f0e Fix handling of empty_data's \Closure value in Date/Time form types
symfony-splitter pushed a commit to symfony/form that referenced this pull requestFeb 3, 2020
…/Time form types (yceruto)This PR was merged into the 3.4 branch.Discussion----------[Form] Fix handling of empty_data's \Closure value in Date/Time form types| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       | Fix #33188| License       | MIT| Doc PR        | -Basically this would solve the posibility to pass a `\Closure` to the `empty_data` option for Date/Time form types.>https://symfony.com/doc/current/reference/forms/types/form.html#empty-data> If a form is compound, you can set empty_data as an array, object or **closure**. See the [How to Configure empty Data](https://symfony.com/doc/current/form/use_empty_data.html) for a Form Class article for more details about these options.Also related tosymfony/symfony#29182Commits-------4939f0e323 Fix handling of empty_data's \Closure value in Date/Time form types
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@xabbuhxabbuhxabbuh approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

+1 more reviewer

@anytanytanyt left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

2.8

Development

Successfully merging this pull request may close these issues.

5 participants

@HeahDude@nicolas-grekas@xabbuh@anyt@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp