diff --git a/Resources/views/Elfinder/ckeditor.html.twig b/Resources/views/Elfinder/ckeditor.html.twig index ac646c2..4080b63 100644 --- a/Resources/views/Elfinder/ckeditor.html.twig +++ b/Resources/views/Elfinder/ckeditor.html.twig @@ -27,7 +27,7 @@ getFileCallback : function(file) { if (funcNum) { {% if relative_path %} - window.opener.CKEDITOR.tools.callFunction(funcNum, '{{ pathPrefix }}'+file.path); + window.opener.CKEDITOR.tools.callFunction(funcNum, '{{ pathPrefix }}'+file.url.replace("{{ app.request.schemeAndHttpHost }}/", "")); {% else %} window.opener.CKEDITOR.tools.callFunction(funcNum, file.url); {% endif %} diff --git a/Resources/views/Elfinder/elfinder_type.html.twig b/Resources/views/Elfinder/elfinder_type.html.twig index 9007a6a..df8ef36 100644 --- a/Resources/views/Elfinder/elfinder_type.html.twig +++ b/Resources/views/Elfinder/elfinder_type.html.twig @@ -16,7 +16,7 @@ lang : '{{locale}}', getFileCallback: function(file) { {% if relative_path %} - window.opener.setValue('{{ pathPrefix }}'+file.path, "{{ id }}"); + window.opener.setValue('{{ pathPrefix }}'+file.url.replace("{{ app.request.schemeAndHttpHost }}/", ""), "{{ id }}"); {% else %} window.opener.setValue(file.url, "{{ id }}"); {% endif %} diff --git a/Resources/views/Elfinder/tinymce.html.twig b/Resources/views/Elfinder/tinymce.html.twig index f407c63..7754a2a 100644 --- a/Resources/views/Elfinder/tinymce.html.twig +++ b/Resources/views/Elfinder/tinymce.html.twig @@ -51,7 +51,7 @@ folders : false }, getFileCallback : function(url) { - path = '/' + url.path; + path = '/' + url.replace("{{ app.request.schemeAndHttpHost }}/", ""); FileBrowserDialogue.mySubmit(path); } }).elfinder('instance'); diff --git a/Resources/views/Elfinder/tinymce4.html.twig b/Resources/views/Elfinder/tinymce4.html.twig index 1ca0127..b732b0a 100644 --- a/Resources/views/Elfinder/tinymce4.html.twig +++ b/Resources/views/Elfinder/tinymce4.html.twig @@ -30,7 +30,7 @@ lang : '{{ locale }}', getFileCallback: function(file) { // editor callback {% if relative_path %} - FileBrowserDialogue.mySubmit('{{ pathPrefix }}'+file.path); // pass selected file path to TinyMCE + FileBrowserDialogue.mySubmit('{{ pathPrefix }}'+file.url.replace("{{ app.request.schemeAndHttpHost }}/", "")); // pass selected file path to TinyMCE {% else %} FileBrowserDialogue.mySubmit(file.url); // pass selected file path to TinyMCE {% endif %}