helios-ag / FMElfinderBundle

:file_folder: ElFinderBundle provides ElFinder integration with TinyMCE, CKEditor, Summernote editors
MIT License
275 stars 128 forks source link

Argument #5 ($result) must be of type array, null given #500

Open escopecz opened 1 year ago

escopecz commented 1 year ago

Describe the bug

FM\\ElfinderBundle\\Event\\ElFinderPostExecutionEvent::__construct(): Argument #5 ($result) must be of type array, null given, called in /var/www/html/vendor/helios-ag/fm-elfinder-bundle/src/Controller/ElFinderController.php on line 218

This is where the error happens:

https://github.com/helios-ag/FMElfinderBundle/blob/main/src/Controller/ElFinderController.php#L216-L218

The load method returns void (null) when cors_support is disabled:

https://github.com/helios-ag/FMElfinderBundle/blob/main/src/Loader/ElFinderLoader.php#L98

I don't get why is this coming up now when the code around this is 8 years old.

The event requires the 5th param to be type of array:

https://github.com/helios-ag/FMElfinderBundle/blob/main/src/Event/ElFinderPostExecutionEvent.php#L23

To Reproduce Load the ElFinder without the cors_support

(OPTIONAL) Additional context So I'm turning the cors_support ON as a way around this for now. I don't get how come it worked up till now. Perhaps PHP version upgrade made this visible.

escopecz commented 1 year ago

Hey, this is error 500. In 2 ways :)

ColonelMoutarde commented 1 year ago

Hello, same error

Luvelnet commented 1 year ago

Hey, the shame error here. How set CORS_SUPPORT ON?... thanks!

ColonelMoutarde commented 1 year ago

I have downgrade to the previous version to slove this.

escopecz commented 1 year ago

Here is the doc about the cors_support: https://github.com/helios-ag/FMElfinderBundle/blob/main/docs/cors-support.md

Luvelnet commented 1 year ago

Aquí está el documento sobre cors_support: https://github.com/helios-ag/FMElfinderBundle/blob/main/docs/cors-support.md

Thank you!

Luvelnet commented 1 year ago

I have new error:

php.CRITICAL: Uncaught Error: set_time_limit(): Argument #1 ($seconds) must be of type int, string given {"exception":"[object] (TypeError(code: 0): set_time_limit():

Anyone know to solve?

helios-ag commented 1 year ago

@Luvelnet, @escopecz, @ColonelMoutarde tagged new version, hope it helps, I believe it was due to declare(strict_types=1) which spread downs its restrictions to elfinder lib itself