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

DataTransformer cookbook – strip_tags is a bad example? #6431

Copy link
Copy link
Closed
@MacDada

Description

@MacDada
Issue body actions

The cookbook suggests to use DataTransformer to strip_tags from input.

Isn't that violation of "Transforms a value between different representations"?

I mean, when u strip tags, it's not that representation of data changes – it's the data itself that gets changed. Stripping tags is a losing data procedure.

A cleaner way would be to use form event listener to change the data.

The example is almost right to use DataTransformer to change '<br>'s to "\n" and vice versa – almost, because the input could have both '<br>'s and "\n" – the original information, which should be where, would be lost as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FormHack DayactionableClear and specific issues ready for anyone to take them.Clear and specific issues ready for anyone to take them.bughasPRA Pull Request has already been submitted for this issue.A Pull Request has already been submitted for this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

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