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] RepeatedType should always have inner types mapped#36411

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

Conversation

@biozshock
Copy link
Contributor

@biozshockbiozshock commentedApr 10, 2020
edited
Loading

QA
Branch?3.4
Bug fix?yes
New feature?no
Deprecations?no
Doc PRsymfony/symfony-docs#13519
TicketsFix#36410
LicenseMIT

Always set mapped=true to override inner type mapped setting.
Throw an exception if inner types of RepeatedType has mapped=false

@biozshockbiozshockforce-pushed therepeated-type_not-mapped branch 2 times, most recently from479d0f6 to7cfe1feCompareApril 10, 2020 11:55
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.

Great! I was about to suggest you to create PR to do so, thanks!

It adds complexity to validate the option, but we can easily enforce the expected behavior so I'm 👍 for targeting 3.4 with this fix.

* @param string $configurationKey
* @dataProvider notMappedConfigurationKeys
*/
publicfunctiontestNotMappedInner($configurationKey)
Copy link
Contributor

Choose a reason for hiding this comment

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

Then this could be removed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Or better, adapted to have the same behavior as the other.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

done

@biozshockbiozshockforce-pushed therepeated-type_not-mapped branch 2 times, most recently from9af2203 to2c80cb8CompareApril 10, 2020 16:41
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.

Thanks! (minor comment)

]))
->add($options['first_name'],$options['type'],array_merge($options['options'],$options['first_options']))
->add($options['second_name'],$options['type'],array_merge($options['options'],$options['second_options']))
->add(
Copy link
Contributor

@HeahDudeHeahDudeApr 10, 2020
edited
Loading

Choose a reason for hiding this comment

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

Please keep it on one line to follow our standards, this also reduces the diff.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Thought fabbot will complain about 120 symbols line.

@biozshock
Copy link
ContributorAuthor

Added doc PR.

HeahDude reacted with heart emoji

@nicolas-grekasnicolas-grekas added this to the3.4 milestoneApr 10, 2020
}

/**
* @param string $configurationKey

Choose a reason for hiding this comment

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

please remove this line

HeahDude reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Done!

Just a side question in case you have time: Wouldn't such comments ease moving to typehinted scalar types when 3.4 will be EOL and 4.4 will require 7.1?

Copy link
Contributor

Choose a reason for hiding this comment

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

Tests are not covered by BC promise, we do add those in the code base though.

Copy link
Member

@nicolas-grekasnicolas-grekasApr 10, 2020
edited
Loading

Choose a reason for hiding this comment

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

We already added all possible types in 5.0, we should not forget to add it here also that's true; but if we do, that's no big deal (and eventually someone will figure out :) )

HeahDude and biozshock reacted with thumbs up emoji
@biozshockbiozshockforce-pushed therepeated-type_not-mapped branch from780e74d to728cd66CompareApril 10, 2020 19:29
@xabbuh
Copy link
Member

Wouldn't it make sense to check if we could make the type work with themapped option set tofalse?

@HeahDude
Copy link
Contributor

You mean ignoring the option or config setting? It could if we target master with a new feature as the mapping is a requirement for the transformer to do the proper validation. I think that trying to do otherwise will lead to adding unnecessary complexity. Unless you see a simple way to do it?

@xabbuh
Copy link
Member

What about something like#36430?

@nicolas-grekasnicolas-grekas changed the titleRepeatedType should always have inner types mapped[Form] RepeatedType should always have inner types mappedApr 13, 2020
@nicolas-grekas
Copy link
Member

Thank you@biozshock.

@nicolas-grekasnicolas-grekas merged commitf702863 intosymfony:3.4Apr 13, 2020
This was referencedApr 28, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@stofstofstof left review comments

@xabbuhxabbuhxabbuh approved these changes

+1 more reviewer

@HeahDudeHeahDudeHeahDude approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

6 participants

@biozshock@xabbuh@HeahDude@nicolas-grekas@stof@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp