Skip to content
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

[Serializer] Handle true and false appropriately in CSV encoder #32007

Merged
merged 1 commit into from Jun 14, 2019

Conversation

Projects
None yet
7 participants
@battye
Copy link
Contributor

commented Jun 12, 2019

Q A
Branch? 3.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #27642
License MIT
Doc PR -

Previously, if true was passed in as a value to the CSV encoder then fputcsv() would correctly treat it as 1. However, if false was passed in, it would be treated as a blank value. null would also be treated as a blank value.

This fix makes it consistent so that true and false will map to 1 and 0, while null maps to an empty string.

@battye battye force-pushed the battye:bugfix/csv-encoder branch 2 times, most recently from b3ce057 to 25f8411 Jun 13, 2019

@battye battye force-pushed the battye:bugfix/csv-encoder branch from 25f8411 to 805dd49 Jun 13, 2019

@battye battye force-pushed the battye:bugfix/csv-encoder branch from ae229e4 to 58a7f46 Jun 14, 2019

@battye battye changed the title [Serializer] Handle true, false, null appropriately in CSV encoder [Serializer] Handle true and false appropriately in CSV encoder Jun 14, 2019

@fabpot

fabpot approved these changes Jun 14, 2019

@fabpot fabpot force-pushed the battye:bugfix/csv-encoder branch from 56c01b8 to 89cba00 Jun 14, 2019

@fabpot

This comment has been minimized.

Copy link
Member

commented Jun 14, 2019

Thank you @battye.

@fabpot fabpot merged commit 89cba00 into symfony:3.4 Jun 14, 2019

1 of 3 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
fabbot.io Your code looks good.
Details

fabpot added a commit that referenced this pull request Jun 14, 2019

bug #32007 [Serializer] Handle true and false appropriately in CSV en…
…coder (battye)

This PR was squashed before being merged into the 3.4 branch (closes #32007).

Discussion
----------

[Serializer] Handle true and false appropriately in CSV encoder

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

Previously, if `true` was passed in as a value to the CSV encoder then `fputcsv()` would correctly treat it as 1. However, if `false` was passed in, it would be treated as a blank value. `null` would also be treated as a blank value.

This fix makes it consistent so that true and false will map to 1 and 0, while null maps to an empty string.

Commits
-------

89cba00 [Serializer] Handle true and false appropriately in CSV encoder

@nicolas-grekas nicolas-grekas added this to the 3.4 milestone Jun 17, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.