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

AbstractController->dispatchPostEvents expects Symfony File instead of FlysystemFile #444

Closed
seizan8 opened this issue Mar 22, 2024 · 6 comments · Fixed by #445
Closed
Assignees
Labels
Milestone

Comments

@seizan8
Copy link

seizan8 commented Mar 22, 2024

Bug Report

Uploading a file returns Error:

"Oneup\UploaderBundle\Controller\AbstractController::dispatchPostEvents(): Argument #1 ($uploaded) must be of type Symfony\Component\HttpFoundation\File\File, Oneup\UploaderBundle\Uploader\File\FlysystemFile given, called in /var/www/html/vendor/oneup/uploader-bundle/src/Controller/AbstractController.php on line 128"

Q A
Symfony 6.4.3
Oneup/UploaderBundle 5.0.0
Oneup/FlysystemBundle 4.11.2
Dropzone 6.0.0-beta.2

Summary

After setting up Oneup/UploaderBundle, Oneup/FlysystemBundle and Dropzone I tested out the upload and received an error.

It seems like Oneup\UploaderBundle\Uploader\Storage\FlysystemStorage->upload returns a Oneup\UploaderBundle\Uploader\File\FlysystemFile. And Oneup\UploaderBundle\Controller->dispatchPostEvents expects a Symfony\Component\HttpFoundation\File\File.

Either FlysystemFile needs to extend the Symfony File class. Or the parameter type in AbstractController->dispatchPostEvents should be changed to Oneup\UploaderBundle\Uploader\File\FileInterface.

How to reproduce

I believe it happens whenever you use Oneup/UploaderBundle v5.0.0 und try to upload a file.

@bytehead bytehead added the bug label Mar 25, 2024
@bytehead bytehead added this to the 5.x milestone Mar 25, 2024
@Rikijs
Copy link

Rikijs commented Mar 31, 2024

Just hit the same bug, but with Uppy library.
Problem arised after: updating to Oneup/UploaderBundle 5.0.0.

Q A
Symfony 6.4.3
Oneup/UploaderBundle 5.0.0
Oneup/FlysystemBundle 4.12.0
Uppy 3.23

@bytehead bytehead mentioned this issue Apr 3, 2024
@bytehead bytehead self-assigned this Apr 3, 2024
@bytehead
Copy link
Member

bytehead commented Apr 3, 2024

@seizan8 / @Rikijs thanks for reporting! 🙏

Does #445 (dev-fix/wrong-typehint) solve your issue?

@Rikijs
Copy link

Rikijs commented Apr 3, 2024

Hello, @bytehead!
Yes, for me, patch allowes upload to function as intended.
Thank you for a speedy fix!

@bytehead
Copy link
Member

bytehead commented Apr 4, 2024

5.0.1 is out! Thanks again for reporting! 🙏

@seizan8
Copy link
Author

seizan8 commented Apr 15, 2024

@bytehead Sorry for the late reply. Can confim, it works now with v5.0.1.
Thank you for the quick fix! :)

@bytehead
Copy link
Member

You're welcome! Thanks for the feedback.

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 a pull request may close this issue.

3 participants