FMElfinderBundle icon indicating copy to clipboard operation
FMElfinderBundle copied to clipboard

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

Open escopecz opened this issue 1 year ago • 8 comments

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 avatar May 11 '23 09:05 escopecz

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

escopecz avatar May 11 '23 09:05 escopecz

Hello, same error

ColonelMoutarde avatar May 11 '23 19:05 ColonelMoutarde

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

Luvelnet avatar May 11 '23 21:05 Luvelnet

I have downgrade to the previous version to slove this.

ColonelMoutarde avatar May 12 '23 05:05 ColonelMoutarde

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

escopecz avatar May 12 '23 07:05 escopecz

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

Thank you!

Luvelnet avatar May 12 '23 10:05 Luvelnet

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?

Luvelnet avatar May 12 '23 10:05 Luvelnet

@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

helios-ag avatar May 13 '23 08:05 helios-ag