Better handling of missing attachments and empty attachment paths
This commit is contained in:
parent
1f84890a4a
commit
806d6823f2
|
@ -1937,7 +1937,11 @@ Zotero.Item.prototype.numNotes = function() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the first line of the note for display in the items list
|
* Get the first line of the note for display in the items list
|
||||||
**/
|
*
|
||||||
|
* Note: Note titles can also come from Zotero.Items.cacheFields()!
|
||||||
|
*
|
||||||
|
* @return {String}
|
||||||
|
*/
|
||||||
Zotero.Item.prototype.getNoteTitle = function() {
|
Zotero.Item.prototype.getNoteTitle = function() {
|
||||||
if (!this.isNote() && !this.isAttachment()) {
|
if (!this.isNote() && !this.isAttachment()) {
|
||||||
throw ("getNoteTitle() can only be called on notes and attachments");
|
throw ("getNoteTitle() can only be called on notes and attachments");
|
||||||
|
@ -2127,6 +2131,11 @@ Zotero.Item.prototype.getFile = function(row, skipExistsCheck) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!row.path) {
|
||||||
|
Zotero.debug("Attachment path is empty", 2);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (row.linkMode == Zotero.Attachments.LINK_MODE_IMPORTED_URL ||
|
if (row.linkMode == Zotero.Attachments.LINK_MODE_IMPORTED_URL ||
|
||||||
row.linkMode == Zotero.Attachments.LINK_MODE_IMPORTED_FILE) {
|
row.linkMode == Zotero.Attachments.LINK_MODE_IMPORTED_FILE) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -1083,8 +1083,9 @@ Zotero.Sync.Storage = new function () {
|
||||||
|
|
||||||
var file = item.getFile();
|
var file = item.getFile();
|
||||||
if (!file) {
|
if (!file) {
|
||||||
_error("File " + file.leafName + " not found for item "
|
_removeRequest(request);
|
||||||
+ itemID + " after extracting ZIP");
|
_queueAdvance('download', Zotero.Sync.Storage.downloadFile, true);
|
||||||
|
_error("File not found for item " + item.id + " after extracting ZIP");
|
||||||
}
|
}
|
||||||
file.lastModifiedTime = syncModTime * 1000;
|
file.lastModifiedTime = syncModTime * 1000;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user