Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Form] Don't rely on `Symfony\Component\HttpFoundation\File\File` if http-foundation isn't installed in FileType #25152

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -93,7 +93,7 @@ public function finishView(FormView $view, FormInterface $form, array $options)
public function configureOptions(OptionsResolver $resolver)
{
$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';

This comment has been minimized.

Copy link
@nicolas-grekas

nicolas-grekas Nov 26, 2017

Member

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

This comment has been minimized.

Copy link
@issei-m

issei-m Nov 26, 2017

Author Contributor

I agree with you, and fixed it.

};
$emptyData = function (Options $options) {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.