Skip to content

DataTransformer cookbook – strip_tags is a bad example? #6431

Closed
@MacDada

Description

@MacDada

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.bughasPRA 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