Fix error saving imported attachments on trunk (since r3178)
This commit is contained in:
parent
552008468e
commit
7637434a2a
2 changed files with 14 additions and 1 deletions
|
@ -300,6 +300,7 @@ Zotero.Attachments = new function(){
|
||||||
attachmentItem.save();
|
attachmentItem.save();
|
||||||
|
|
||||||
Zotero.Notifier.trigger('add', 'item', itemID);
|
Zotero.Notifier.trigger('add', 'item', itemID);
|
||||||
|
Zotero.Notifier.trigger('modify', 'item', sourceItemID);
|
||||||
|
|
||||||
// We don't have any way of knowing that the file
|
// We don't have any way of knowing that the file
|
||||||
// is flushed to disk, so we just wait a second
|
// is flushed to disk, so we just wait a second
|
||||||
|
|
|
@ -2297,6 +2297,10 @@ Zotero.Item.prototype.__defineGetter__('attachmentLinkMode', function () {
|
||||||
return this._attachmentLinkMode;
|
return this._attachmentLinkMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.id) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
var sql = "SELECT linkMode FROM itemAttachments WHERE itemID=?";
|
var sql = "SELECT linkMode FROM itemAttachments WHERE itemID=?";
|
||||||
var linkMode = Zotero.DB.valueQuery(sql, this.id);
|
var linkMode = Zotero.DB.valueQuery(sql, this.id);
|
||||||
this._attachmentLinkMode = linkMode;
|
this._attachmentLinkMode = linkMode;
|
||||||
|
@ -2349,6 +2353,10 @@ Zotero.Item.prototype.__defineGetter__('attachmentMIMEType', function () {
|
||||||
return this._attachmentMIMEType;
|
return this._attachmentMIMEType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.id) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
var sql = "SELECT mimeType FROM itemAttachments WHERE itemID=?";
|
var sql = "SELECT mimeType FROM itemAttachments WHERE itemID=?";
|
||||||
var mimeType = Zotero.DB.valueQuery(sql, this.id);
|
var mimeType = Zotero.DB.valueQuery(sql, this.id);
|
||||||
if (!mimeType) {
|
if (!mimeType) {
|
||||||
|
@ -2398,6 +2406,10 @@ Zotero.Item.prototype.__defineGetter__('attachmentCharset', function () {
|
||||||
return this._attachmentCharset;
|
return this._attachmentCharset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.id) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
var sql = "SELECT charsetID FROM itemAttachments WHERE itemID=?";
|
var sql = "SELECT charsetID FROM itemAttachments WHERE itemID=?";
|
||||||
var charset = Zotero.DB.valueQuery(sql, this.id);
|
var charset = Zotero.DB.valueQuery(sql, this.id);
|
||||||
if (!charset) {
|
if (!charset) {
|
||||||
|
@ -2439,7 +2451,7 @@ Zotero.Item.prototype.__defineGetter__('attachmentPath', function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.id) {
|
if (!this.id) {
|
||||||
return undefined;
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
var sql = "SELECT path FROM itemAttachments WHERE itemID=?";
|
var sql = "SELECT path FROM itemAttachments WHERE itemID=?";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue