Skip to content

Update src/Symfony/Component/Form/Extension/Core/Type/FileType.php#5028

Closed
stfalcon wants to merge 2 commits intosymfony:masterfrom
stfalcon:patch-1
Closed

Update src/Symfony/Component/Form/Extension/Core/Type/FileType.php#5028
stfalcon wants to merge 2 commits intosymfony:masterfrom
stfalcon:patch-1

Conversation

@stfalcon
Copy link
Copy Markdown
Contributor

@webmozart
Copy link
Copy Markdown
Contributor

Thank you for the PR! Could you please add a test case?

@stfalcon
Copy link
Copy Markdown
Contributor Author

Could you please add a test case?

And what to check? I added one static option :)

@webmozart
Copy link
Copy Markdown
Contributor

Whatever was the reason for adding the option ;) The test should fail when the option is not added and succeed when the option is there.

Probably it is sufficient to create a new field of type "file" in the test which comes prefilled with a File object.

$file = $this->getMock('Symfony\Component\HttpFoundation\File\File');
$this->factory->create('file', $file)

@stfalcon stfalcon closed this Aug 27, 2012
@stfalcon stfalcon reopened this Nov 12, 2012
@stfalcon stfalcon closed this Nov 15, 2012
@stfalcon
Copy link
Copy Markdown
Contributor Author

sorry, it's bug in VichUploaderBundle

@stfalcon
Copy link
Copy Markdown
Contributor Author

or not :)

@stfalcon stfalcon reopened this Nov 21, 2012
@stfalcon
Copy link
Copy Markdown
Contributor Author

@bschussek done! it was really a bug with FileType

@stfalcon
Copy link
Copy Markdown
Contributor Author

@stof who can merge it? I want close this bug dustin10/VichUploaderBundle#27 :)

@stof
Copy link
Copy Markdown
Member

stof commented Nov 23, 2012

@stfalcon the rule is that only @fabpot merges PRs on symfony.

@stfalcon
Copy link
Copy Markdown
Contributor Author

@fabpot do you have a minute :)? it's simple PR but many people wait for it

@fvilpoix
Copy link
Copy Markdown

Hello,

Since this update, I've got a 500 error instead of validation failure when I try to post a form without a required file.

Warning: Missing argument 1 for Symfony\Component\HttpFoundation\File\File::__construct(), called in […]/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/FormType.php on line 172 and defined in […]/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/File/File.php line 38

@piotrantosik
Copy link
Copy Markdown
Contributor

I have same error as @fvilpoix

@choomz
Copy link
Copy Markdown

choomz commented Nov 27, 2012

I have the same error on my side. This change means that we must necessarily provide Symfony File objects on forms input and output ?

I fail to see how this can work as in this case, nothing is passed to the File constructor.

@stfalcon
Copy link
Copy Markdown
Contributor Author

Hmm. @bschussek, "Houston, we have a problem"

@Sybio
Copy link
Copy Markdown

Sybio commented Nov 30, 2012

+1 same error !

@stfalcon
Copy link
Copy Markdown
Contributor Author

@fabpot can you revert changes? and reopen this issue.

@dchaffin
Copy link
Copy Markdown

I am getting this same error.

@dchaffin
Copy link
Copy Markdown

I did find this 'fix':

#6134

@frodosghost
Copy link
Copy Markdown

Same error.

@cedric-pouilleux
Copy link
Copy Markdown

Yes, I have the same error, when i edit, and when the field file is empty :(

@gzankevich
Copy link
Copy Markdown

The fix posted by dchaffin works for me. It's a little worrying that a security update (2.1.4) ended up breaking functionality.

@ghost
Copy link
Copy Markdown

ghost commented Dec 7, 2012

Same error and the fix posted by dchaffin doesn't works for me :/

@alainivars
Copy link
Copy Markdown

Same error to minoz and the fix posted by dchaffin doesn't works for me to

@webmozart
Copy link
Copy Markdown
Contributor

Fixed in #6319

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Symfony's form component cleanup.