Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Form] Always normalize CRLF and CR to LF in TextareaType#62841

Merged
nicolas-grekas merged 1 commit into
symfony:6.4from
alexandre-daubois:crlf-textarea
Dec 23, 2025
Merged

[Form] Always normalize CRLF and CR to LF in TextareaType#62841
nicolas-grekas merged 1 commit into
symfony:6.4from
alexandre-daubois:crlf-textarea

Conversation

@alexandre-daubois
Copy link
Copy Markdown
Member

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #62611
License MIT

Comment thread .github/expected-missing-return-types.diff Outdated
@nicolas-grekas
Copy link
Copy Markdown
Member

Thank you @alexandre-daubois.

@nicolas-grekas nicolas-grekas merged commit e6b46c7 into symfony:6.4 Dec 23, 2025
11 of 12 checks passed
@faizanakram99
Copy link
Copy Markdown
Contributor

@alexandre-daubois @nicolas-grekas This is a breaking change, it changes behaviour, unfortunately our test suite didn't catch this and this broke live environments.

@simonsolutions
Copy link
Copy Markdown

Yes same here, such changes need more attention and between releases.

@alexandre-daubois
Copy link
Copy Markdown
Member Author

Can you explain further how this breaks your app and the use case to understand what we didn't see, please?

@simonsolutions
Copy link
Copy Markdown

For me it was saving a textarea field (multiline) to the database. until the change of that PR it saved \r\n to the TEXT field of the database. Now its only a \n.
Other processes what read the values and process it further didn't split the line correctly what had further impacts on the processes.

@faizanakram99
Copy link
Copy Markdown
Contributor

We have a custom form type for a multi-email input (on top of textarea) which uses ";" as delimiter at db level and on the frontend it was rendered with "\r\n".

A callback transformer would do the transformation between ";" and "\r\n". Symfony changing "\r\n" to "\n" all of sudden caused the transformer to not transform the values and as such it broke sending out emails. We've ever since fixed this but this is a BC break and shouldn't have been done like this imo.

@xabbuh
Copy link
Copy Markdown
Member

xabbuh commented Jan 22, 2026

@faizanakram99 Can you please try out the fix I propose in #63154?

nicolas-grekas added a commit that referenced this pull request Jan 22, 2026
…ng submitted newlines (xabbuh)

This PR was merged into the 6.4 branch.

Discussion
----------

[Form] don't skip custom view transformers while normalizing submitted newlines

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #62841 (comment)
| License       | MIT

Commits
-------

8348420 don't skip custom view transformers while normalizing submitted newlines
@faizanakram99
Copy link
Copy Markdown
Contributor

@faizanakram99 Can you please try out the fix I propose in #63154?

Sorry, we already made adjustments to our code, it is difficult to get back to previous state again and check against existing data.

@faizanakram99
Copy link
Copy Markdown
Contributor

faizanakram99 commented Jan 23, 2026

@faizanakram99 Can you please try out the fix I propose in #63154?

Sorry, we already made adjustments to our code, it is difficult to get back to previous state again and check against existing data.

nvm, I am testing it. Will report the results.

UPDATE: Sorry couldn't get into previous state.

@simonsolutions
Copy link
Copy Markdown

For my case I also made fixes to the application. But with the new 7.4.4 release where the fix was implemented, i still get only "\n" as new line and not "\r\n" as before 7.4.3.
I changed my application so its working for me, but the behaviour hasn't changed back.

@xabbuh
Copy link
Copy Markdown
Member

xabbuh commented Jan 26, 2026

For my case I also made fixes to the application. But with the new 7.4.4 release where the fix was implemented, i still get only "\n" as new line and not "\r\n" as before 7.4.3.

I think that’s expected because it’s precisely the bugfix that was included in 7.4.3.

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