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] deprecate using invalid names for buttons#28969

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:masterfromxabbuh:issue-28964
Feb 21, 2019

Conversation

@xabbuh
Copy link
Member

QA
Branch?master
Bug fix?no
New feature?no
BC breaks?no
Deprecations?yes
Tests pass?yes
Fixed tickets#28964
LicenseMIT
Doc PR

$this->name =$name;
$this->options =$options;

if (\preg_match('/^([^a-z0-9_].*)?(.*[^a-zA-Z0-9_\-:].*)?$/D',$name,$matches)) {
Copy link
Member

Choose a reason for hiding this comment

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

Just asking: is this validating the value of thename HTML attribute of<button> elements ... or is this a Symfony thing? I say this because HTML allows for example: as the first character ofname.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

It affects both. The internal name is used to generate the HTML attribute value. Buttons will then behave the same as "normal" form types already behave.

@xabbuh
Copy link
MemberAuthor

ping @symfony/deciders :)

@fabpot
Copy link
Member

Thank you@xabbuh.

@fabpotfabpot merged commit405aa54 intosymfony:masterFeb 21, 2019
fabpot added a commit that referenced this pull requestFeb 21, 2019
This PR was merged into the 4.3-dev branch.Discussion----------[Form] deprecate using invalid names for buttons| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | no| BC breaks?    | no| Deprecations? | yes| Tests pass?   | yes| Fixed tickets |#28964| License       | MIT| Doc PR        |Commits-------405aa54 deprecate using invalid names for buttons
@xabbuhxabbuh deleted the issue-28964 branchFebruary 21, 2019 07:49
@nicolas-grekasnicolas-grekas modified the milestones:next,4.3Apr 30, 2019
@fabpotfabpot mentioned this pull requestMay 9, 2019
symfony-splitter pushed a commit to symfony/form that referenced this pull requestMay 29, 2019
…eruto)This PR was merged into the 5.0-dev branch.Discussion----------[Form] Throw exception for invalid form buttons name| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -Seesymfony/symfony#28969Commits-------6deeaa42ae Validating form buttons name
nicolas-grekas added a commit that referenced this pull requestMay 29, 2019
…eruto)This PR was merged into the 5.0-dev branch.Discussion----------[Form] Throw exception for invalid form buttons name| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -See#28969Commits-------6deeaa4 Validating form buttons name
fabpot added a commit that referenced this pull requestSep 25, 2019
This PR was merged into the 4.3 branch.Discussion----------[Form] Names for buttons should start with lowercase| Q             | A| ------------- | ---| Branch?       | 4.3| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | N/A| License       | MIT| Doc PR        | N/AThis fix changes the messages related to the changes in#28969 - the message used to state that names should start with a letter, a digit ... - so I got a confusing message:```Using names for buttons that do not start with a letter, a digit, or an underscore is deprecated since Symfony 4.3 and will throw an exception in 5.0 ("Search" given).'```Which made me find the message, look at the regex that was used, and work out that actually it should start with a lowercase letter, and hence this PR - where I assume there is a reason that the name must start with lowercase letters.Commits-------f65524e Names for buttons should start with lowercase
symfony-splitter pushed a commit to symfony/form that referenced this pull requestSep 25, 2019
This PR was merged into the 4.3 branch.Discussion----------[Form] Names for buttons should start with lowercase| Q             | A| ------------- | ---| Branch?       | 4.3| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | N/A| License       | MIT| Doc PR        | N/AThis fix changes the messages related to the changes insymfony/symfony#28969 - the message used to state that names should start with a letter, a digit ... - so I got a confusing message:```Using names for buttons that do not start with a letter, a digit, or an underscore is deprecated since Symfony 4.3 and will throw an exception in 5.0 ("Search" given).'```Which made me find the message, look at the regex that was used, and work out that actually it should start with a lowercase letter, and hence this PR - where I assume there is a reason that the name must start with lowercase letters.Commits-------f65524e4e0 Names for buttons should start with lowercase
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@javiereguiluzjaviereguiluzjaviereguiluz left review comments

@fabpotfabpotfabpot approved these changes

+2 more reviewers

@rpkamprpkamprpkamp left review comments

@ogizanagiogizanagiogizanagi left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.3

Development

Successfully merging this pull request may close these issues.

7 participants

@xabbuh@fabpot@javiereguiluz@rpkamp@ogizanagi@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp