Skip to content

[Form] accept floats for input="string" in NumberType #32125

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
Jun 22, 2019

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Jun 20, 2019

Q A
Branch? 4.3
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #31905, #32124
License MIT
Doc PR

Copy link
Member

@yceruto yceruto left a comment

Choose a reason for hiding this comment

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

Thanks!!

@fancyweb
Copy link
Contributor

fancyweb commented Jun 21, 2019

Shouldn't we trigger a deprecation here so users actually uses string instead of floats in their entities?

@xabbuh xabbuh changed the title [Form] don't reject floats in StringToFloatTransformer [Form] accepts floats for input="string" in NumberType Jun 21, 2019
@xabbuh
Copy link
Member Author

xabbuh commented Jun 21, 2019

I have updated the code a bit. The changes made for the StringToFloatTransformer have been reverted. Instead the NumberType takes care of the type cast.

This allows us to deprecate the behaviour with a better message in 4.4 as suggested in #32125 (comment) and we do not need to weaken the StringToFloatTransformer.

@xabbuh xabbuh changed the title [Form] accepts floats for input="string" in NumberType [Form] accept floats for input="string" in NumberType Jun 21, 2019
@xabbuh
Copy link
Member Author

xabbuh commented Jun 21, 2019

@fancyweb see #32130

fabpot added a commit that referenced this pull request Jun 22, 2019
…ype (xabbuh)

This PR was merged into the 4.4 branch.

Discussion
----------

[Form] deprecate int/float for string input in NumberType

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #32125 (comment)
| License       | MIT
| Doc PR        |

Commits
-------

d8c008a deprecate int/float for string input in NumberType
@fabpot
Copy link
Member

fabpot commented Jun 22, 2019

Thank you @xabbuh.

@fabpot fabpot merged commit 2abf855 into symfony:4.3 Jun 22, 2019
fabpot added a commit that referenced this pull request Jun 22, 2019
…buh)

This PR was merged into the 4.3 branch.

Discussion
----------

[Form] accept floats for input="string" in NumberType

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #31905, #32124
| License       | MIT
| Doc PR        |

Commits
-------

2abf855 accept floats for input="string" in NumberType
@xabbuh xabbuh deleted the issue-31905 branch June 22, 2019 11:09
@fabpot fabpot mentioned this pull request Jun 26, 2019
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.

6 participants