Drag and drop file://path (from Zotero) into composition's attachment pane should attach the file
Categories
(Thunderbird :: Message Compose Window, defect)
Tracking
(Not tracked)
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.
Comment 1•4 years ago
|
||
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.
Comment 2•4 years ago
|
||
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…?
Comment 3•4 years ago
|
||
Here's a screencast showing that it works.
| Reporter | ||
Comment 4•4 years ago
|
||
| Reporter | ||
Comment 5•4 years ago
|
||
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;
}
| Reporter | ||
Updated•4 years ago
|
| Reporter | ||
Comment 6•4 years ago
|
||
(In reply to M Lopez-Ibanez from comment #4)
The attachment was a mistake, is it possible to delete it?
| Reporter | ||
Updated•4 years ago
|
| Reporter | ||
Comment 7•2 years ago
|
||
This works for me in 102
Description
•