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

Appearance settings

[Form] Fixed empty conversion of Intl types #21481

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 1 commit into from
Mar 5, 2017

Conversation

HeahDude
Copy link
Contributor

Q A
Branch? 3.2
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #20759, #21475
License MIT
Doc PR ~

Copy link
Member

@xabbuh xabbuh left a comment

Choose a reason for hiding this comment

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

👍

Status: Reviewed

@geoffrey-brier
Copy link
Contributor

Many thanks @HeahDude 👍

@HeahDude
Copy link
Contributor Author

HeahDude commented Feb 1, 2017

Please wait before merging.

Status: I need to check something

@yceruto
Copy link
Member

yceruto commented Feb 1, 2017

@HeahDude, This solution force null for empty string (good), but what if the dev needs to change this behavior through a callable choice_value option?

I wondering removing these optimization could solves the problem instead of current solution, because $value will be null always unless you pass a custom choice_value option?

@HeahDude
Copy link
Contributor Author

HeahDude commented Feb 1, 2017

@yceruto I don't really understand what you want to improve here.

Indeed $value depends on choice_value option. The filtering added in this PR just prevents to handle empty string because there is no such need with countries, locales, etc.

@nicolas-grekas
Copy link
Member

Status update @HeahDude ?

@HeahDude
Copy link
Contributor Author

HeahDude commented Feb 6, 2017

I'll be very busy this week, but now I've missed today's releases so I guess there is no rush.

Status: needs extra work in 2.7 :)

@fabpot
Copy link
Member

fabpot commented Mar 1, 2017

@HeahDude Any news?

@HeahDude
Copy link
Contributor Author

HeahDude commented Mar 5, 2017

Finally see #21879 which adds the failing tests. Will need a rebase once this other is merged.

fabpot added a commit that referenced this pull request Mar 5, 2017
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Hardened form type tests

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ~
| License       | MIT
| Doc PR        | ~

This one the PRs to come targeting 2.7 needed to harden the code base before doing some changes in master.

It takes care of the form types tests part (even if some other tests will be added later, it will also be easier after it), and unlocks merging #21481.
It also back ports tests added in #18357 for the TextType.

Since it's very hard to merge branches when modifying tests because of BC, and making every test type extend the base type test would involve many function calls to get the tested type, the function `getTestedType` is no longer abstract and return a constant to override instead, it's much better for performance, I didn't change the call in the base type test to keep BC but I suggest to deprecate it in master. Even if those are tests I really think it is worth keeping BC here.

The constants also ease testing in the ecosystem of form related libraries that need to be compatible with Symfony 2.7 and 3. I think using "test" as both prefix and suffix on namespaces, classes and names of the constants should discourage using them in real application code. Since this is just about our test suite, I don't think this should be considered a feature, so tis change should be good for 2.7.

Two other PRs will follow to solve conflicts in 2.8 and 3.2.

I missed last month patches, I hope I won't this time :).

Commits
-------

8cfc3e9 [Form] Hardened form type tests
@HeahDude HeahDude force-pushed the fix/bc-break-choice-types branch from 6e58155 to e43bfaf Compare March 5, 2017 17:48
@fabpot
Copy link
Member

fabpot commented Mar 5, 2017

Thank you @HeahDude.

@fabpot fabpot merged commit e43bfaf into symfony:3.2 Mar 5, 2017
fabpot added a commit that referenced this pull request Mar 5, 2017
This PR was merged into the 3.2 branch.

Discussion
----------

[Form] Fixed empty conversion of Intl types

| Q             | A
| ------------- | ---
| Branch?       | 3.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #20759, #21475
| License       | MIT
| Doc PR        | ~

Commits
-------

e43bfaf [Form] Fixed empty conversion of Intl types
@HeahDude HeahDude deleted the fix/bc-break-choice-types branch March 5, 2017 18:20
@fabpot fabpot mentioned this pull request Mar 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.