Closed Bug 1714385 Opened 4 years ago Closed 2 years ago

Drag and drop file://path (from Zotero) into composition's attachment pane should attach the file

Categories

(Thunderbird :: Message Compose Window, defect)

Unspecified
Linux
defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: lopezibanez, Unassigned)

Details

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:89.0) Gecko/20100101 Firefox/89.0

Steps to reproduce:

Drag and drop a PDF file from Zotero (https://www.zotero.org) into the attachment box of Thunderbird.

Actual results:

Nothing

Expected results:

The file pointed by the entry is attached. In fact, Zotero just passes a "file:///....pdf" link. Dragging and dropping into Firefox does open the PDF file.

Did this ever work before? Is this a link to a PDF on Zotero that you're dragging into TB? That shouldn't work. FF is a browser and should work. TB is expecting you to have the file locally and drag into the attachment window.

WFM on 78.11.0 (32-bit), Win10.

Can drag and drop file://...pdf into TB composition without any problems.

  • Are you using a Linux distro? (If yes, please try official download from TB)
  • Bug also happens after ≡ > Help > Restart with Addons Disabled…?
Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Flags: needinfo?(lopezibanez)
Resolution: --- → WORKSFORME
Summary: Drag and drop path into attachment box should attach the file → Drag and drop file://path (from Zotero) into composition's attachment pane should attach the file

Here's a screencast showing that it works.

Attached file Troubleshooting information (obsolete) —
I tried with all add-ons disabled and it doesn't do what you show: * TB 78.11.0 (64-bit) * Zotero 5.0.96.3

I tried with all add-ons disabled and it doesn't do what you show:

  • TB 78.11.0 (64-bit)
  • Zotero 5.0.96.3

When I drag it to the textbox it gives something like: ‘Deb et al. - 2010 - An Interactive Evolutionary Multiobjective Optimiz.Pdf’, n.d.

When I drag it to the attachment box, nothing happens and nothing appears in the error console.

Dragging to Dolphin or the Konsole or even dragging to the Firefox toolbar works as a path.

By looking in the debugger, I can see that the dropped data contains these types:

0: "zotero/item"
1: "application/x-moz-file"
2: "text/html"
3: "text/x-moz-url"
4: "text/plain"

In MsgComposeCommands.js this is handled by using type "applications/x-moz-file", but it triggers an exception:

Couldn't process the dragged file undefined:[Exception... "Could not convert JavaScript argument arg 0 [nsIFileProtocolHandler.getURLSpecFromFile]" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)" location: "JS frame :: chrome://messenger/content/messengercompose/MsgComposeCommands.js :: onDrop :: line 7753" data: no] MsgComposeCommands.js:7756
onDrop chrome://messenger/content/messengercompose/MsgComposeCommands.js:7756
ondrop chrome://messenger/content/messengercompose/messengercompose.xhtml:1

in this code:

    // Process attachments.
    case "application/x-moz-file": {
      if (data instanceof Ci.nsIFile) {
        size = data.fileSize;
      }
      try {
        data = Services.io
          .getProtocolHandler("file")
          .QueryInterface(Ci.nsIFileProtocolHandler)
          .getURLSpecFromFile(data);
        isValidAttachment = true;
      } catch (e) {
        Cu.reportError(
          "Couldn't process the dragged file " + data.leafName + ":" + e
        );
      }
      break;
    }
Attachment #9238758 - Attachment is obsolete: true
Flags: needinfo?(lopezibanez)

(In reply to M Lopez-Ibanez from comment #4)
The attachment was a mistake, is it possible to delete it?

Status: RESOLVED → UNCONFIRMED
OS: Unspecified → Linux
Resolution: WORKSFORME → ---

This works for me in 102

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago2 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: