Project

General

Profile

Actions

Defect #32656

closed

Drag and drop objects from Outlook to Redmine deletes the objects

Added by Andrey Sergeev over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Attachments
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

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.


Files

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

Updated by Go MAEDA over 4 years 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.

Actions #2

Updated by Andrey Sergeev over 4 years 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.

Actions #3

Updated by Guillermo ML over 4 years 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)

Actions #4

Updated by Andrey Sergeev over 4 years 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.

Actions #5

Updated by Yuichi HARADA over 4 years 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() {
Actions #6

Updated by Simon Hori about 4 years 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)
Actions #7

Updated by Yuichi HARADA about 4 years 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).

Actions #8

Updated by Simon Hori about 4 years 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.

Actions #9

Updated by Go MAEDA about 4 years 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.

Actions #10

Updated by Go MAEDA about 4 years ago

  • Category set to Attachments
Actions #11

Updated by Cédric Berger about 4 years 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

Actions #12

Updated by Cédric Berger about 4 years ago

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

Actions #13

Updated by Matthias Kastner about 4 years 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]

Actions #14

Updated by Go MAEDA about 4 years ago

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

Committed the patch. Thank you for your contribution.

Actions #15

Updated by Go MAEDA about 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF