Fixes #696, dateAdded is null in toArray() before getField() is called

This commit is contained in:
Dan Stillman 2007-09-15 20:20:56 +00:00
parent 9e6d6c5376
commit 2f9301e6f2

View File

@ -2855,7 +2855,7 @@ Zotero.Items = new function(){
} }
// Should be the same as parts in Zotero.Item.loadFromID // Should be the same as parts in Zotero.Item.loadFromID
var sql = 'SELECT I.itemID, I.itemTypeID, I.dateModified, ' var sql = 'SELECT I.itemID, I.itemTypeID, I.dateAdded, I.dateModified, '
+ getFirstCreatorSQL() + ', ' + getFirstCreatorSQL() + ', '
+ "(SELECT COUNT(*) FROM itemNotes WHERE sourceItemID=I.itemID) AS numNotes, " + "(SELECT COUNT(*) FROM itemNotes WHERE sourceItemID=I.itemID) AS numNotes, "
+ "(SELECT COUNT(*) FROM itemAttachments WHERE sourceItemID=I.itemID) AS numAttachments " + "(SELECT COUNT(*) FROM itemAttachments WHERE sourceItemID=I.itemID) AS numAttachments "
@ -2881,7 +2881,7 @@ Zotero.Items = new function(){
if (!arguments[0]) { if (!arguments[0]) {
_itemsLoaded = true; _itemsLoaded = true;
_cachedFields = ['itemID', 'itemTypeID', 'dateModified', _cachedFields = ['itemID', 'itemTypeID', 'dateAdded', 'dateModified',
'firstCreator', 'numNotes', 'numAttachments', 'numChildren']; 'firstCreator', 'numNotes', 'numAttachments', 'numChildren'];
} }
} }