redmine_ckeditor
redmine_ckeditor copied to clipboard
Image upload is broken in Email notification
Hi
When i click "Browse and upload image" and insert image into issue description, the image is shown normally on web browser, but it's broken in notification email.
However, If I upload image by this function and then right click on this image, select "Image properties" and add my Redmine hostname before the URL in Image Info, it works.
I think the reason why image is broken because hostname of image's URL in email is mail server, not my Redmine.
Could you pls let me know how to set the hostname when insert image by Upload Image function?
Thank you.
Hi chobong
Have you fix this issue?
Hi, i have this same issue and fixed myself. Not the best way, but i included (hardcoded) the HOST URL (like http://localhost, or similar) when upload an image to Upload Image Browser. It worked on e-mails and still working on redmine too.
File: redmine_ckeditor/assets/ckeditor-contrib/plugins/richfile/plugin.js
editor._.insertImagefn = CKEDITOR.tools.addFunction(function(url, id, name){
this.insertHtml('');
}, editor);
Where getHost() is my function to load "http://localhost"
So I found this old thread because I had the same problem.
It seems that the code in @phoebusnetto 's comment was garbled by Github's editor.
Here is how I solved this, in assets/ckeditor-contrib/plugins/richfile/plugin.js
, edit the insertImagefn
function to add the hostname like this :
editor._.insertImagefn = CKEDITOR.tools.addFunction(function(url, id, name){
this.insertHtml('<img src="https://example.com/' + url + '" alt="" data-rich-file-id="' + id + '" />');
}, editor);