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
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
Do you have Symfony contracts in vendors?
Yes in version 1.1.5
Please try to require dev-fix-dispatcher and see if it works
Thank you for your quick answer.
The bundle looks operationnal again with these corrections.
Do you plan to tag it soon ?
Immediately