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

Bad dispatch in UploadHandler #1018

Closed
ngilain opened this issue Jul 10, 2019 · 5 comments
Closed

Bad dispatch in UploadHandler #1018

ngilain opened this issue Jul 10, 2019 · 5 comments
Labels

Comments

@ngilain
Copy link

ngilain commented Jul 10, 2019

Bug Report

Since the last tag, the upload on several of our projects are broken due to a mistake in the call of the Symfony dispatcher.

Q A
BC Break no
Version 1.10.0

Summary

When trying to upload some file on a Symfony 3.4 project, this error message appears :

Type error: Argument 2 passed to Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher::dispatch() must be an instance of Symfony\Component\EventDispatcher\Event or null, string given, called in /home/wwwroot/scp/vendor/vich/uploader-bundle/Handler/UploadHandler.php on line 110

The fact is that the recently added test to manage both versions of Symfony dispatch is ok, but the dispatch themselves are inverted in the if/else.

For instance on my project in Symfony 3.4, the code go on line https://github.com/dustin10/VichUploaderBundle/blob/1.10.0/Handler/UploadHandler.php#L110 which generate the bug as the call should be

$this->dispatcher->dispatch($eventName, $event);

Best regards

@garak
Copy link
Collaborator

garak commented Jul 10, 2019

Do you have Symfony contracts in vendors?

@ngilain
Copy link
Author

ngilain commented Jul 11, 2019

Yes in version 1.1.5

@garak garak added the Bug label Jul 11, 2019
garak added a commit that referenced this issue Jul 11, 2019
@garak
Copy link
Collaborator

garak commented Jul 11, 2019

Please try to require dev-fix-dispatcher and see if it works

@ngilain
Copy link
Author

ngilain commented Jul 11, 2019

Thank you for your quick answer.

The bundle looks operationnal again with these corrections.

Do you plan to tag it soon ?

@garak
Copy link
Collaborator

garak commented Jul 11, 2019

Immediately

@garak garak closed this as completed Jul 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants