From 8e4f9d517337713cd669320d01ebe6cb8c33d4fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 17 Apr 2020 21:08:07 +0200 Subject: [PATCH] Fix attaching images in CKEditor via drag and drop The URL used for the generated request was `/ckeditor/pictures&responseType=json`. This is a known issue in the ckeditor gem, and it's suggested to add a `?` at the end of the URL in order to fix it. I haven't added a test for this case since simulating dropping a file in the browser with Selenium/Capybara seems to be quite tricky and I haven't found a solution guaranteed to correctly emulate what users do. --- app/assets/javascripts/ckeditor/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/ckeditor/config.js b/app/assets/javascripts/ckeditor/config.js index 22c4ab028..53b091508 100644 --- a/app/assets/javascripts/ckeditor/config.js +++ b/app/assets/javascripts/ckeditor/config.js @@ -10,7 +10,7 @@ CKEDITOR.editorConfig = function( config ) config.filebrowserImageBrowseLinkUrl = "/ckeditor/pictures"; config.filebrowserImageBrowseUrl = "/ckeditor/pictures"; - config.filebrowserImageUploadUrl = "/ckeditor/pictures"; + config.filebrowserImageUploadUrl = "/ckeditor/pictures?"; config.filebrowserUploadMethod = "form"; config.allowedContent = true;