Skip to content

[Liferaft] File input and the new request objects #3024

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

Closed
wants to merge 1 commit into from

Conversation

NormySan
Copy link

When using the new request objects with file inputs result i weird problems.

Go to the / route and there will be two forms for testing the same thing with
and without a request object.

For some reason errors are not showing up on this installation for me,
I'm just getting blank pages.

The issues showing up on this liferaft example is the same as i'm getting on
one of my other projects, there i get the following exception thrown when
submitting a form with an empty file input field:

InvalidArgumentException thrown with message "An uploaded file must be an array or an instance of UploadedFile."

Stacktrace:
#26 InvalidArgumentException in /home/vagrant/Code/jarvis/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/FileBag.php:59
#25 Symfony\Component\HttpFoundation\FileBag:set in /home/vagrant/Code/jarvis/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/FileBag.php:73
#24 Symfony\Component\HttpFoundation\FileBag:add in /home/vagrant/Code/jarvis/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/FileBag.php:48
#23 Symfony\Component\HttpFoundation\FileBag:replace in /home/vagrant/Code/jarvis/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/FileBag.php:37
#22 Symfony\Component\HttpFoundation\FileBag:__construct in /home/vagrant/Code/jarvis/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php:245
#21 Symfony\Component\HttpFoundation\Request:initialize in /home/vagrant/Code/jarvis/vendor/laravel/framework/src/Illuminate/Foundation/Providers/FormRequestServiceProvider.php:57
#20 Illuminate\Foundation\Providers\FormRequestServiceProvider:initializeRequest in /home/vagrant/Code/jarvis/vendor/laravel/framework/src/Illuminate/Foundation/Providers/FormRequestServiceProvider.php:35
#19 Illuminate\Foundation\Providers\FormRequestServiceProvider:Illuminate\Foundation\Providers{closure} in /home/vagrant/Code/jarvis/vendor/laravel/framework/src/Illuminate/Container/Container.php:839
#18 Illuminate\Container\Container:fireCallbackArray in /home/vagrant/Code/jarvis/vendor/laravel/framework/src/Illuminate/Container/Container.php:824
#17 Illuminate\Container\Container:fireResolvingCallbacks in /home/vagrant/Code/jarvis/vendor/laravel/framework/src/Illuminate/Container/Container.php:565
#16 Illuminate\Container\Container:make in /home/vagrant/Code/jarvis/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:472
#15 Illuminate\Foundation\Application:make in /home/vagrant/Code/jarvis/vendor/laravel/framework/src/Illuminate/Routing/RouteDependencyResolverTrait.php:55
#14 Illuminate\Routing\ControllerDispatcher:resolveMethodDependencies in /home/vagrant/Code/jarvis/vendor/laravel/framework/src/Illuminate/Routing/RouteDependencyResolverTrait.php:34
#13 Illuminate\Routing\ControllerDispatcher:resolveClassMethodDependencies in /home/vagrant/Code/jarvis/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php:97
#12 Illuminate\Routing\ControllerDispatcher:call in /home/vagrant/Code/jarvis/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php:66
#11 Illuminate\Routing\ControllerDispatcher:dispatch in /home/vagrant/Code/jarvis/vendor/laravel/framework/src/Illuminate/Routing/Route.php:155
#10 Illuminate\Routing\Route:dispatchToController in /home/vagrant/Code/jarvis/vendor/laravel/framework/src/Illuminate/Routing/Route.php:129
#9 Illuminate\Routing\Route:run in /home/vagrant/Code/jarvis/vendor/laravel/framework/src/Illuminate/Routing/Router.php:1030
#8 Illuminate\Routing\Router:dispatchToRoute in /home/vagrant/Code/jarvis/vendor/laravel/framework/src/Illuminate/Routing/Router.php:996
#7 Illuminate\Routing\Router:dispatch in /home/vagrant/Code/jarvis/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:812
#6 Illuminate\Foundation\Application:dispatch in /home/vagrant/Code/jarvis/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:789
#5 Illuminate\Foundation\Application:handle in /home/vagrant/Code/jarvis/vendor/laravel/framework/src/Illuminate/Session/Middleware.php:72
#4 Illuminate\Session\Middleware:handle in /home/vagrant/Code/jarvis/vendor/laravel/framework/src/Illuminate/Cookie/Queue.php:47
#3 Illuminate\Cookie\Queue:handle in /home/vagrant/Code/jarvis/vendor/laravel/framework/src/Illuminate/Cookie/Guard.php:51
#2 Illuminate\Cookie\Guard:handle in /home/vagrant/Code/jarvis/vendor/stack/builder/src/Stack/StackedHttpKernel.php:23
#1 Stack\StackedHttpKernel:handle in /home/vagrant/Code/jarvis/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:665
#0 Illuminate\Foundation\Application:run in /home/vagrant/Code/jarvis/public/index.php:49

@taylorotwell
Copy link
Member

I'm unable to recreate this. Are you fully up to date on Laravel 5.0?

@NormySan
Copy link
Author

Just did a composer update and tried it again. Still getting the same invalid argument exception when i submit the first form without any input at all.

"An uploaded file must be an array or an instance of UploadedFile."

@taylorotwell
Copy link
Member

Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants