ejyothi / MantisBT-MarkDownEditor

A MantisBT plugin to enable MarkDown Editor for text fields
5 stars 1 forks source link

Cannot create issues in Mantis with image attachments #6

Closed libregeek closed 7 years ago

libregeek commented 7 years ago

Attaching files on report issue page in Google Chrome (Fedora) and Mozilla Firefox (Fedora) produces the Content Security Policy error. Everything is working fine when disabling the plugin. screenshot from 2017-03-27 12-12-24

ajtruckle commented 7 years ago

Yes, I also had a user bring this to my attention and I had to disable the plugin.

Sent from my iPhone

On 27 Mar 2017, at 08:10, Manilal notifications@github.com<mailto:notifications@github.com> wrote:

Attaching files on report issue page in Google Chrome (Fedora) and Mozilla Firefox (Fedora) produces the Content Security Policy error. Everything is working fine when disabling the plugin.

[screenshot from 2017-03-27 12-12-24]https://cloud.githubusercontent.com/assets/145110/24344693/4ef1d6f8-12ea-11e7-975f-b8ab5bcd3dc7.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/ejyothi/MantisBT-MarkDownEditor/issues/6, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AHnYs3IQefLGUA4XVH5TC7XmWiACrKbMks5rp2D2gaJpZM4Mp3ug.

darias-soa commented 7 years ago

My users are experiencing this issue as well. We are on Mantis 2.2.1 and MDE 0.1.

ajtruckle commented 7 years ago

I am not sure if it is related but do you know that mantis only allows markdown with images that are on the same server ? It won't allow external links to images.

Sent from my iPhone

On 28 Mar 2017, at 16:48, darias-soa notifications@github.com<mailto:notifications@github.com> wrote:

My users are experiencing this issue as well. We are on Mantis 2.2.1 and MDE 0.1.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/ejyothi/MantisBT-MarkDownEditor/issues/6#issuecomment-289814076, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AHnYs1m_y8cDjucvxw9pvvY0C_lVSzoAks5rqSu8gaJpZM4Mp3ug.

darias-soa commented 7 years ago

Yep, these are images we're uploading directly during the issue submission process.

libregeek commented 7 years ago

I thought that Refused to load the image... because it violates the following Content Security Policy directive: "img-src 'self'" was the root cause of this issue. But error occurs even if MarkDown Editor plugin is disabled. So I guess this browser console message has nothing to do with the issue.

libregeek commented 7 years ago

No error if I try to create an issue without an attachment.

libregeek commented 7 years ago

I disabled dropzone and the plugin works fine. It seems there is some conflict between Dropzone and SimpleMDE. As a temporary workaround disable dropzone if you are using MarkDown editor. $g_dropzone_enabled = OFF;

libregeek commented 7 years ago

A related thread: https://github.com/enyo/dropzone/issues/470

ghost commented 7 years ago

it seems when there is attachment in the Dropzone, the description you typed are deleted when you clicked the "submit issue" button. the Description field is mandatory field that is why mantis is throwing and error.

libregeek commented 7 years ago

@ehrtz see the comment above: https://github.com/ejyothi/MantisBT-MarkDownEditor/issues/6#issuecomment-290063798

ghost commented 7 years ago

@libregeek I know, i edited the plugin.js and commented out the the following code var descMde = new SimpleMDE({ element: document.getElementById("description"), autoDownloadFontAwesome: false, spellChecker: false, toolbar: ["bold", "italic", "heading", "|", "unordered-list", "ordered-list", "|", "link", "image", "|", "quote", "code", "table", "|", "preview", "guide"], });

Then tried to submit new issue by entering required field like category, summary and description. Also put some text in Step to Reproduce and Additional Information. then add attachement to the dropzone then submit. The issue was submitted and saved with Description and attachment but Step to Reproduce and Additional Information was not saved.

libregeek commented 7 years ago

@ehrtz @darias-soa @ajtruckle I replaced SimpleMDE with a much simpler one. It's not feature rich like SimpleMDE, but it doesn't have any issues/conflicts with native browser functions and dropzone (in Mantis). It would be nice if you could test and let me know your thoughts.

ajtruckle commented 7 years ago

I like it :)