Defect #32656

Drag and drop objects from Outlook to Redmine deletes the objects

Added by Andrey Sergeev 5 months ago. Updated 3 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Attachments
Target version:4.0.7
Resolution:Fixed 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

Associated revisions

Revision 19566
Added by Go MAEDA 3 months ago

Fix that drag and drop objects from Outlook to Redmine deletes them (#32656).

Patch by Yuichi HARADA.

Revision 19567
Added by Go MAEDA 3 months ago

Merged r19566 from trunk to 4.1-stable (#32656).

Revision 19568
Added by Go MAEDA 3 months ago

Merged r19566 from trunk to 4.0-stable (#32656).

History

#1 Updated by Go MAEDA 5 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 5 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 5 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 5 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 4 months 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 4 months 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 4 months 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 4 months 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 4 months 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 4 months ago

  • Category set to Attachments

#11 Updated by Cédric Berger 4 months 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 4 months ago

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

#13 Updated by Matthias Kastner 3 months ago

Cédric Berger wrote:

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

Any automatic deletion is actually unwanted behaviour for most users. Regardless of the key stroke combination pattern. If the user wants to delete an Email from his inbox, he should always do that manually by using outlook‘s native delete functionality or hit [DEL]

#14 Updated by Go MAEDA 3 months ago

  • Status changed from New to Resolved
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch. Thank you for your contribution.

#15 Updated by Go MAEDA 3 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF