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] Don't rely onSymfony\Component\HttpFoundation\File\File if http-foundation isn't installed in FileType#25152

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

Closed
issei-m wants to merge2 commits intosymfony:2.7fromissei-m:fix-file-type

Conversation

@issei-m
Copy link
Contributor

@issei-missei-m commentedNov 24, 2017
edited
Loading

QA
Branch?2.7
Bug fix?yes
New feature?no
BC breaks?may need discussion
Deprecations?no
Tests pass?yes
Fixed ticketsn/a
LicenseMIT
Doc PRn/a

CurrentlyFileType may depend onSymfony\Component\HttpFoundation\File\File regardlesshttp-foundation has been installed or not.
It leads to occur the class-not-found error.
(Attached the screen capture, please see below and I provided the representationhere for your information)

So I ensureSymfony\Component\HttpFoundation\File\File does exist, and if not, we don't specify any classes for this type.
While setting no specified class todata_class means makingproperty path behavior changed,
NativeRequestHandler which is usually expected to be used in non-full-stack env handles a pure array like$_FILES holds, fully intended behavior AFAIK.

image

Copy link
Contributor

@srozesroze left a comment

Choose a reason for hiding this comment

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

Yep, seems legit 👍

{
$dataClass =function (Options$options) {
return$options['multiple'] ?null :'Symfony\Component\HttpFoundation\File\File';
return$options['multiple']|| !class_exists('Symfony\Component\HttpFoundation\File\File')?null :'Symfony\Component\HttpFoundation\File\File';

Choose a reason for hiding this comment

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

shouldn't the check be done a few lines below, when callingsetDefaults?

issei-m 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.

I agree with you, and fixed it.

@nicolas-grekasnicolas-grekas added this to the2.7 milestoneNov 26, 2017
@fabpot
Copy link
Member

Thank you@issei-m.

fabpot added a commit that referenced this pull requestNov 26, 2017
…e\File` if http-foundation isn't in FileType (issei-m)This PR was squashed before being merged into the 2.7 branch (closes#25152).Discussion----------[Form] Don't rely on `Symfony\Component\HttpFoundation\File\File` if http-foundation isn't in FileType| Q             | A| ------------- | ---| Branch?       | 2.7| Bug fix?      | yes| New feature?  | no| BC breaks?    | may need discussion| Deprecations? | no| Tests pass?   | yes| Fixed tickets | n/a| License       | MIT| Doc PR        | n/aCurrently `FileType` may depend on `Symfony\Component\HttpFoundation\File\File` regardless `http-foundation` has been installed or not.It leads to occur the class-not-found error.(Attached the screen capture, please see below and I provided the representation [here](issei-m/form-bug-representation#1) for your information)So I ensure `Symfony\Component\HttpFoundation\File\File` does exist, and if not, we don't specify any classes for this type.While setting no specified class to `data_class` means making [property path behavior changed](https://github.com/symfony/symfony/blob/7234bfd56a9aa388db839af066f24c7ec70f86e9/src/Symfony/Component/Form/Form.php#L229-L231),[NativeRequestHandler](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/NativeRequestHandler.php) which is usually expected to be used in non-full-stack env handles a pure array like `$_FILES` holds, fully intended behavior AFAIK.![image](https://user-images.githubusercontent.com/1135118/33216654-14706a56-d178-11e7-8e4b-c38c14ec7532.png)Commits-------a264238 [Form] Don't rely on  if http-foundation isn't in FileType
@fabpotfabpot closed thisNov 26, 2017
@issei-missei-m deleted the fix-file-type branchNovember 29, 2017 15:43
This was referencedNov 30, 2017
@issei-missei-m changed the title[Form] Don't rely onSymfony\Component\HttpFoundation\File\File if http-foundation isn't in FileType[Form] Don't rely onSymfony\Component\HttpFoundation\File\File if http-foundation isn't installed in FileTypeDec 1, 2017
This was referencedDec 4, 2017
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

@fabpotfabpotfabpot approved these changes

@xabbuhxabbuhxabbuh approved these changes

+1 more reviewer

@srozesrozesroze approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

2.7

Development

Successfully merging this pull request may close these issues.

6 participants

@issei-m@fabpot@nicolas-grekas@sroze@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp