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

Fixes sprintf(): Too few arguments in form transformer#36907

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
nicolas-grekas merged 1 commit intosymfony:3.4frompedrocasado:patch-sprintf
May 30, 2020
Merged

Fixes sprintf(): Too few arguments in form transformer#36907

nicolas-grekas merged 1 commit intosymfony:3.4frompedrocasado:patch-sprintf
May 30, 2020

Conversation

@pedrocasado
Copy link
Contributor

Similar to:#29482

QA
Branch?3.4
Bug fix?yes
New feature?no
Deprecations?no
Ticketsnone
LicenseMIT
Doc PRnone

Fixes the form reverse transformation when the method viewToNorm is called within a value with the character %:

Before : "sprintf(): Too few arguments"

After : Form reverse transformation works.

Reference :http://php.net/manual/function.sprintf.php

@xabbuh
Copy link
Member

Can we add a test case to prevent future regressions (IIRC this was done recently to satisfy fabbot.io)?

@ro0NL
Copy link
Contributor

Hi@pedrocasado can you also have a look at#36954 maybe :)

pedrocasado reacted with thumbs up emoji

Copy link
Contributor

@TobionTobion left a comment

Choose a reason for hiding this comment

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

Seems like most (all?) of this was already fixed, e.g. in#36684
You need to rebase.

@Tobion
Copy link
Contributor

Please add a test as suggested by@xabbuh for at least one case like the Form transformation.

@pedrocasado
Copy link
ContributorAuthor

@Tobion , can you give me some guidance? do you think this test is enough?

public function testDataTransformationEscapesValueCorrectlyInException(){    $this->expectException('Symfony\Component\Form\Exception\TransformationFailedException');    $this->expectExceptionMessage('Unable to transform data for property path "name": No mapping for value "90%"');    $model = new FixedDataTransformer([        'default' => 'foo',    ]);    $view = new FixedDataTransformer([        'foo' => 'bar',    ]);    $config = new FormConfigBuilder('name', null, $this->dispatcher);    $config->addViewTransformer($view);    $config->addModelTransformer($model);    $config->setData('90%');    $form = new Form($config);    $form->getData();}

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

(let's skip adding tests for this...)

@nicolas-grekas
Copy link
Member

Thank you@pedrocasado.

@nicolas-grekasnicolas-grekas merged commite8beef4 intosymfony:3.4May 30, 2020
This was referencedMay 31, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@xabbuhxabbuhAwaiting requested review from xabbuhxabbuh is a code owner

@TobionTobionAwaiting requested review from Tobion

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

7 participants

@pedrocasado@xabbuh@ro0NL@Tobion@nicolas-grekas@stof@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp