Skip to content

[Form] Documented the setInvalidMessage() method for data transformers #11756

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

Merged
merged 1 commit into from
Jun 21, 2019

Conversation

javiereguiluz
Copy link
Member

This fixes #11559.

@wouterj
Copy link
Member

wouterj commented Jun 14, 2019

TransformationFailedException should be used when transformation failed. Data mappers shouldn't transform data, DataTransformers should. DataMappers should only map (the transformed) data to the subject (entity, DTO, array, etc).

So 👍 for documenting this feature, but please add it to the DataTransformer article to not advocate wrong usage

@javiereguiluz
Copy link
Member Author

Wouter, thanks for the review ... I've reverted the changes to explain this in the data transformers article.

Copy link
Member

@wouterj wouterj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I'll merge later today, I want to do a minor reword while merging :)

@xabbuh
Copy link
Member

xabbuh commented Jun 19, 2019

@javiereguiluz Could you reword the commit message to talk about data transformers instead of data mappers? Might be less confusing for some future reader of the git history. :)

@xabbuh xabbuh changed the title [Form] Documented the setInvalidMessage() method for data mappers [Form] Documented the setInvalidMessage() method for data transformers Jun 19, 2019
@xabbuh
Copy link
Member

xabbuh commented Jun 19, 2019

Ah, maybe that's not necessary. I edited the PR title and during merge we will squash anyway (which should take the PR title as the commit message if I am not mistaken)

@wouterj wouterj merged commit 5c20204 into symfony:4.3 Jun 21, 2019
wouterj added a commit that referenced this pull request Jun 21, 2019
…ata transformers (javiereguiluz)

This PR was squashed before being merged into the 4.3 branch (closes #11756).

Discussion
----------

[Form] Documented the setInvalidMessage() method for data transformers

This fixes #11559.

Commits
-------

5c20204 [Form] Documented the setInvalidMessage() method for data transformers
@wouterj
Copy link
Member

wouterj commented Jun 21, 2019

Thank you @javiereguiluz! I've added a bit more info on transformer errors in e33b5b2 and also used a slightly different reason to use exceptions: to show specific errors and include user information, instead of showing a static error.

javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull request Jun 21, 2019
* 4.3:
  Add weeks in the options 'labels'
  [symfony#11756] Added a bit more info on transformation errors
  [Form] Documented the setInvalidMessage() method for data transformers
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull request Jun 21, 2019
* 4.4:
  Add weeks in the options 'labels'
  [symfony#11756] Added a bit more info on transformation errors
  [Form] Documented the setInvalidMessage() method for data transformers
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.

5 participants