EmilePerron / tinymce-bundle

TinyMCE 6 integration for your Symfony apps and forms
MIT License
0 stars 0 forks source link

Add support for AssetMapper #3

Open EmilePerron opened 1 month ago

EmilePerron commented 1 month ago

The following issues on the eckinox/tinymce-bundle seem to be happening in projects that use AssetMapper:

The assets loaded in templates/form/tinymce_type.html.twig are referenced as follows:

When AssetMapper is used, these might not actually point to the right path/URL anymore due to the bundling/versioning that is taking place, which might cause 404 or other errors.

EmilePerron commented 1 month ago

So the main issue with AssetMapper I found with usage is that it adds versions to the JS filenames, but TinyMCE doesn't use standard imports, and instead tries to find the files itself based on the directory of the main script. Seeing as it doesn't know about the versioned filenames, it fails to find the right files and that leads to lots of 404s.

A potential solution would be to:

I don't have a huge amount of time on my hands at the moment, so if anyone is interested in making a PR for this to get it fixed more quickly, I'd be happy to review & merge it.