taqueci / redmine_wysiwyg_editor

Redmine WYSIWYG Editor plugin
GNU General Public License v2.0
114 stars 27 forks source link

redmine_knowledgebase plugin not support on Visual editor & Preview #135

Closed kay54068 closed 1 year ago

kay54068 commented 2 years ago

HI I have install the redmine_knowledgebase plugin , is not support on Visual editor & Preview about this:

Video_2021-09-23_112617

How to do fixed it?

Thibaut69 commented 2 years ago

I'v also a problem when I drag and drop a PNG file, the image is broken like on your GIF.

If I go to textile mode, I see that the path is not correct, I mean :

My path of the PNG look like : https://mydns/redmineattachments/download/10667/file.PNG

And it should be : https://mydns/redmine/attachments/download/10667/file.PNG

Any idea where to fix the code to have this / between redmine and attachments ?

Thibaut69 commented 2 years ago

I'v also a problem when I drag and drop a PNG file, the image is broken like on your GIF.

If I go to textile mode, I see that the path is not correct, I mean :

My path of the PNG look like : https://mydns/redmineattachments/download/10667/file.PNG

And it should be : https://mydns/redmine/attachments/download/10667/file.PNG

Any idea where to fix the code to have this / between redmine and attachments ?

I've found a way to fix this bug, I've modified the file assets/javascripts/redmine_wysiwyg_editor.js, line 758

Before ['attachments', 'download', id, encodeURIComponent(name)].join('/');

After ['/attachments', 'download', id, encodeURIComponent(name)].join('/');

taqueci commented 2 years ago

Hi @kay54068 and @Thibaut69

Can you please try branch issue/135? I don't know why there is no trailing slash of home path in your Redmine, but I guess this workaround resolves your issues.

kay54068 commented 2 years ago

@taqueci

maybe is knowledge base plugin bug , i disable the visual editor the problem still exists ...

I check the textarea html tag ,There are some differences here:

[Wiki]

<textarea name="content[text]" id="content_text" cols="100" rows="25" accesskey="e" class="wiki-edit" data-auto-complete="true">
h1. Wiki

!2021-09-27_213515.png!</textarea>

[knowledge base plugin]

<textarea cols="60" rows="15" class="wiki-edit" name="article[content]" id="article_content">
h1. knowledgebase

!20211002-222642-680.png!</textarea>
lauer commented 1 year ago

This is now solved - as it was a bug in the other gem.

https://github.com/alexbevi/redmine_knowledgebase/pull/406

(already merged into master)