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] fix post_max_size_message translation (alt. 2)#19061

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.7fromDavidBadura:fix-form-upload-translation2
Jun 22, 2016
Merged

[FORM] fix post_max_size_message translation (alt. 2)#19061

fabpot merged 1 commit intosymfony:2.7fromDavidBadura:fix-form-upload-translation2
Jun 22, 2016

Conversation

@DavidBadura
Copy link
Contributor

QA
Branch?2.7
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#15479,#18543
LicenseMIT
Doc PR-

@DavidBaduraDavidBadura changed the title[FORM] fix post_max_size_message translation[FORM] fix post_max_size_message translation (alt. 2)Jun 15, 2016
*/
public function getExtendedType()
{
return FormType::class;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be'form' as it targets 2.7 and to be changed in 2.8.

@DavidBadura
Copy link
ContributorAuthor

comments addressed

$translator = $this->translator;

$resolver->setNormalizer('post_max_size_message', function (Options $options, $errorMessage) use ($translator) {
return $translator->trans($errorMessage, array(), $this->translationDomain);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just use$this->translator directly as done with$this->translationDomain?

Copy link
Contributor

Choose a reason for hiding this comment

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

Symfony 2.7 need to be compatible with php5.3 so we can't use$this in closures, the$this->translationDomain needs to be replaced.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

oh, that's wrong. $this in anonymous function you can use starting 5.4.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

fixed

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@fabpot
Copy link
Member

It seems weird to create an extension for this, but I think I like this implementation more than the one in#18543, just because it is less intrusive as a bug fix for 2.7.

👍
ping @symfony/deciders

<tagname="form.type_extension"alias="submit" />
</service>
<serviceid="form.type_extension.upload.validator"class="Symfony\Component\Form\Extension\Validator\Type\UploadValidatorExtension">
<tagname="form.type_extension"alias="form" />
Copy link
Contributor

Choose a reason for hiding this comment

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

If I'm not wrongalias is not used anymore

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry I forgot this target 2.7 :)

@HeahDude
Copy link
Contributor

👍

@fabpot
Copy link
Member

Thank you@DavidBadura.

@fabpotfabpot merged commit9d8a5e5 intosymfony:2.7Jun 22, 2016
fabpot added a commit that referenced this pull requestJun 22, 2016
…id Badura)This PR was merged into the 2.7 branch.Discussion----------[FORM] fix post_max_size_message translation (alt. 2)| Q             | A| ------------- | ---| Branch?       | 2.7| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#15479,#18543| License       | MIT| Doc PR        | -Commits-------9d8a5e5 fix post_max_size_message translation
@DavidBaduraDavidBadura deleted the fix-form-upload-translation2 branchJune 22, 2016 14:11
fabpot added a commit that referenced this pull requestJun 29, 2016
… 2.8 (Tobion)This PR was merged into the 2.8 branch.Discussion----------[Form] fix post max size translation type extension for >= 2.8| Q             | A| ------------- | ---| Branch?       | 2.8| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? |no| Tests pass?   | yes| Fixed tickets |#19210,#19061| License       | MIT| Doc PR        |Commits-------a27ec00 [Form] fix post max size translation type extension for >= 2.8
This was referencedJun 30, 2016
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

7 participants

@DavidBadura@fabpot@HeahDude@wouterj@jvasseur@ro0NL@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp