Defect #32656

Drag and drop objects from Outlook to Redmine deletes the objects

Added by Andrey Sergeev 2 months ago. Updated 21 days ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Attachments
Target version:4.0.7
Resolution: Affected version:3.4.5

Description

There is a issue: why when we drag and drop the letters from outlook to the attachements, the letter (from example from inbox) is deleted.
for example, when we drag and drop any file from explorer, this file is not deleted, it is copied to the attachments to redmine.
also when we drag and drop files from outlook to any folder in explorer, the attachments also are not deleted from outlook.
Will be pleased for promt reply.

32656-drop-effect.patch Magnifier (796 Bytes) Yuichi HARADA, 2020-01-29 04:04

History

#1 Updated by Go MAEDA 2 months ago

Do you mean that emails or attachments are deleted from the inbox of Outlook when you drag and drop emails or files to Redmine?

I think Redmine cannot do anything about it because Redmine just receives dropped things and cannot control the drag source and its data. Probably emails or attachments are deleted by Outlook, not Redmine.

#2 Updated by Andrey Sergeev 2 months ago

yes, that's right.
for example when i drag and drop emails to my desktop , they are not deleted from outlook, they copied.
I think it is failure, and i would like to know how it could be fixed.
I think the problem is in Redmine. What are preventions can be made to solve this issue?

Thanks in advance.

#3 Updated by Guillermo ML 2 months ago

The problem has been reported with other web based apps:

Could be that JQuery's upload module has bad behavior when dropEffect is not set? (see the second link for a posible solution)

#4 Updated by Andrey Sergeev 2 months ago

Yes, but i'm not a web-developer. I have users, that have faced with such problem. I don't know where i can use this script (just apply it to google chrome?)
If it can be turned off (JQuery script in google chrome) would appreciate for help.

#5 Updated by Yuichi HARADA about 1 month ago

Set "copy" to dropEffect in the following patch. However, I don't own Outlook, so please check this patch, someone.

diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js
index dd7a8e30e..39315d8f8 100644
--- a/public/javascripts/attachments.js
+++ b/public/javascripts/attachments.js
@@ -185,6 +185,7 @@ handleFileDropEvent.target = '';
 function dragOverHandler(e) {
   $(this).addClass('fileover');
   blockEventPropagation(e);
+  e.dataTransfer.dropEffect = 'copy';
 }

 function dragOutHandler(e) {
@@ -195,6 +196,7 @@ function dragOutHandler(e) {
 function setupFileDrop() {
   if (window.File && window.FileList && window.ProgressEvent && window.FormData) {

+    $.event.fixHooks.dragover = { props: [ 'dataTransfer' ] };
     $.event.fixHooks.drop = { props: [ 'dataTransfer' ] };

     $('form div.box:not(.filedroplistner)').has('input:file.filedrop').each(function() {

#6 Updated by Simon Hori 23 days ago

Thanks for the patch! I believe I added the two lines properly to the js but unfortunately it is still deleting the item from my Outlook and this error is logged when mouse over to the drop area.

attachments.js?1580264756:193 Uncaught TypeError: Cannot set property 'dropEffect' of undefined
    at HTMLDivElement.dragOutHandler (attachments.js?1580264756:193)
    at HTMLDivElement.dispatch (jquery-1.11.1-ui-1.11.0-ujs-3.1.4.js?1571477570:3)
    at HTMLDivElement.r.handle (jquery-1.11.1-ui-1.11.0-ujs-3.1.4.js?1571477570:3)

#7 Updated by Yuichi HARADA 23 days ago

Simon Hori wrote:

Thanks for the patch! I believe I added the two lines properly to the js but unfortunately it is still deleting the item from my Outlook and this error is logged when mouse over to the drop area.

attachments.js?1580264756:193 Uncaught TypeError: Cannot set property 'dropEffect' of undefined
    at HTMLDivElement.dragOutHandler (attachments.js?1580264756:193)

Thank you for confirming the patch. It looks like the patch has been applied to a different line. Is the patch applied properly?
I attached a patch (same as #32656-5).

#8 Updated by Simon Hori 23 days ago

Sorry, you are right. I changed a wrong line in `dragOutHandler` but it must be added to `dragOverHandler` as you wrote.

Now it works perfectly fine with my MS Outlook!!
No deletion occurred after a drag-drop. Thank you.

I hope this fix is included in the next version.

FYI: I confirmed with Redmine 3.4.12, MS Outlook 2010 and Chrome 79.0.3945.130 on Windows 10.

#9 Updated by Go MAEDA 23 days ago

  • Subject changed from Drag and drop letters from outlook to attachments redmine to Drag and drop objects from Outlook to Redmine deletes the objects
  • Target version set to 4.0.7

Simon Hori wrote:

Now it works perfectly fine with my MS Outlook!!
No deletion occurred after a drag-drop. Thank you.

Thank you for the test result. Setting the target version to 4.0.7.

#10 Updated by Go MAEDA 22 days ago

  • Category set to Attachments

#11 Updated by Cédric Berger 21 days ago

I've Redmine 4 customers who find the actual behaviour very convenient:
When they drag an e-mail from Outlook to Redmine, the e-mail disappear from Outlook, while is actually what they want, because the e-mail has been "processed" and should disappear from the Inbox.
Is there a way to keep both behaviour optional?
Cédric

#12 Updated by Cédric Berger 21 days ago

Maybe if the shift key is maintained during the drag+drop, the original email is deleted, or something like that?

Also available in: Atom PDF