Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

[Form] invalidate forms on transformation failures#28731

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:2.8fromxabbuh:issue-20916
Nov 12, 2018

Conversation

@xabbuh
Copy link
Member

@xabbuhxabbuh commentedOct 4, 2018
edited
Loading

QA
Branch?2.8
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#20916,#21242,#28584
LicenseMIT
Doc PR

gmponos and aivus reacted with thumbs up emoji
@xabbuhxabbuh added this to the2.8 milestoneOct 4, 2018
@xabbuhxabbuhforce-pushed theissue-20916 branch 4 times, most recently fromb7df8b9 to6cf76d1CompareOctober 31, 2018 07:07
@xabbuhxabbuh changed the title[WIP][Form] invalidate forms on transformation failures[Form] invalidate forms on transformation failuresOct 31, 2018
@xabbuh
Copy link
MemberAuthor

Test added, PR is ready from my POV

$message = 'This value is not valid.';

if (null !== $this->translator) {
$message = $this->translator->trans($message, array('{{ value }}' => $clientDataAsString));
Copy link
Member

Choose a reason for hiding this comment

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

The message is static then shouldn't the placeholder be there?->trans('This value {{ value }} is not valid.', array('{{ value }}' => $clientDataAsString)) ?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

fixed, thanks for catching it

$message = $this->translator->trans($message, array('{{ value }}' => $clientDataAsString));
}

$form->addError(new FormError($message, 'This value is not valid.', array('{{ value }}' => $clientDataAsString), null, $form->getTransformationFailure()));
Copy link
Member

Choose a reason for hiding this comment

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

Same here for the message template (2nd argument)

@xabbuh
Copy link
MemberAuthor

ping @symfony/deciders :)

foreach ($form as $child) {
if (!$child->isSynchronized()) {
$childrenSynchronized = false;
break;
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be more elegant to justreturn here. Then you wouldn't need $childrenSynchronized variable and guard it later at all

xabbuh reacted with thumbs up emoji
Copy link
Contributor

@HeahDudeHeahDude left a comment

Choose a reason for hiding this comment

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

So elegant :), 👍

@fabpot
Copy link
Member

Thank you@xabbuh.

@fabpotfabpot merged commit385d9df intosymfony:2.8Nov 12, 2018
fabpot added a commit that referenced this pull requestNov 12, 2018
This PR was merged into the 2.8 branch.Discussion----------[Form] invalidate forms on transformation failures| Q             | A| ------------- | ---| Branch?       | 2.8| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#20916,#21242,#28584| License       | MIT| Doc PR        |Commits-------385d9df invalidate forms on transformation failures
@xabbuhxabbuh deleted the issue-20916 branchNovember 12, 2018 07:18
@fabpotfabpot mentioned this pull requestNov 16, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@ycerutoycerutoyceruto left review comments

@fabpotfabpotfabpot approved these changes

+2 more reviewers

@ostroluckyostroluckyostrolucky approved these changes

@HeahDudeHeahDudeHeahDude approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

2.8

Development

Successfully merging this pull request may close these issues.

6 participants

@xabbuh@fabpot@ostrolucky@yceruto@HeahDude@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp