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

battye
Copy link
Contributor

@battye battye 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 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
Copy link
Member

fabpot commented Jun 14, 2019

Thank you @battye.

@fabpot fabpot merged commit 89cba00 into symfony:3.4 Jun 14, 2019
fabpot added a commit that referenced this pull request Jun 14, 2019
…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
This was referenced Jun 26, 2019
sandergo90 pushed a commit to sandergo90/symfony that referenced this pull request Jul 4, 2019
… CSV encoder (battye)

This PR was squashed before being merged into the 3.4 branch (closes symfony#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 | symfony#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
@battye battye deleted the bugfix/csv-encoder branch July 31, 2020 13:45
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.

None yet

7 participants