helios-ag / FMElfinderBundle

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

Updating to 12.2.2 returns a script error #491

Closed UlrichHP closed 1 year ago

UlrichHP commented 1 year ago

Describe the bug I updated the package to 12.2.2 and now elfinder is no longer working.

There is a script error and when looking at the missing js files, the package tries to load them from elfinder/bundles/fmelfinder/... instead of public/bundles/fmelfinder/...

Reverting to 12.2.1 seems to fix this issue. I don't understand what can be causing it.

Screenshot_20230209_121318

Screenshot_20230209_121336

helios-ag commented 1 year ago

Seems like it causes by https://github.com/helios-ag/FMElfinderBundle/pull/489

UlrichHP commented 1 year ago

@helios-ag yes, if i modify baseUrl with asset('bundles/fmelfinder/js') it is working as expected.

I don't know why but setting mainUrl in the Controller seems to modify the base folder and changes it to elfinder instead of public.

UlrichHP commented 1 year ago

@helios-ag I think i found the solution.

In ElFinderController, when defining $mainUrl at line 229, this is a relative path and not absolute. To make it absolute, a / must be added according to the Symfony documentation.

helios-ag commented 1 year ago

thank @UlrichHP ! going to merge

helios-ag commented 1 year ago

tagged as 12.2.3