helios-ag / FMElfinderBundle

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

error 404 for elfinder.min.js and editors.default.min.js when I open the elfinder popup (Dev env OK but Prod env KO) #492

Closed kegilko closed 1 year ago

kegilko commented 1 year ago

Describe the bug On symfony 6, I created a simple input form where a user can upload an image through an elfinder popup. All works perfectly on my local dev environment, but when I click on the elfinder field from my prod environment, the opened popup show 2 errors in alert popins :

image image

If I open the developer tools of my browser, I see theses 404 errors :

image

And, indeed, the paths are not good :

The goods paths are :

I don't understand why the 'elfinder' is added and I don't understand too why on my dev environment the paths of 'elfinder.min.js' and 'editors.default.min.js'.. And it's even stranger because, in another page I have a another form with CKeditor (CKeditor type form in Symfony) and I configure it for use elfinder (the value of the editor param in fm_elfinder.yaml is set to 'ckeditor' of course). In this case, all works fine. (in dev and prod env) But as I explain before, when I click on an simple 'elfinder' field (the value of the editor param in fm_elfinder.yaml is set to 'simple'), the paths of the 'elfinder.min.js' and 'editors.default.min.js' files aren't not good in production environment..

In my fm_elfinder yaml file, I set the asset_path to :

fm_elfinder:
    assets_path: /bundles/fmelfinder # default is /assets, this is where css/js elfinder files are

And below, my public directory containing the '/bundles/fmelfinder' directory (created with the symfony command ./bin/console elfinder:install) :

image

My FMElfinderBundle version is : 12.2.2

Thanks for any help !

UlrichHP commented 1 year ago

I had the same error, reported in the issue #491. Updating to 12.2.3 should fix it.

kegilko commented 1 year ago

hann yes, indeed, the 12.2.3 fix the bug :D Thank you !