Closed TomaszGasior closed 5 years ago
This is source of my problem: https://github.com/FriendsOfSymfony/FOSCKEditorBundle/blob/2.x/src/Renderer/CKEditorRenderer.php#L268
What is the reason of using asset package to generate URL?
How else is it supposed to get the urls? The assets path should point to your assets, not sure if this is valid since I never saw a complain around this
For me this is not intuitive but I checked 7 various bundles with src/Resources/public, only one of them append assets automatically (do not require to do it manually) — it's sonata admin bundle and its doing this the same way as FOSCKEditorBundle.
Maybe it might be useful to allow users to set custom asset package. In my case I am going to create my own assets package and keep default asset package for bundles only.
If you have an idea and can make it in a BC way, I will be glad to merge it.
…and I'm not sure whether it should.
Environment
Symfony packages
Subject
My context: I don't use Webpack encore and "/assets" directory. Instead, my CSS and JS files are placed directly in "/public/assets". For convenience I added
framework.asset.base_path
with value "assets" to make usingasset()
function in Twig templates simpler.For some reason, FOSCKEditorBundle uses path specified in "framework.assets.base_path" to generate its own path to JS files of CKEditor. So, this bundle tries to load CKEditor from URL
/assets/bundles/fosckeditor/ckeditor.js
instead from URL/bundles/fosckeditor/ckeditor.js
.Steps to reproduce
framework.asset.base_path
in framework.yaml to some value, "assets" for example.Expected results
CKEditor should be loaded from URL `/bundles/fosckeditor/ckeditor.js' by default.
Actual results
JS file path is affected by
framework.assets.base_path
setting. Even with 'base_path' set in bundle config, path is affected by that setting.My current workaround: