More data layer changes
- Moved ::_get() and _set() from Collection/Search into DataObject, and disabled in Item - Don't disable new items after save. We now put new objects into the DataObjects cache from save() so that changes made post-save are picked up by other code using .get(). - Added 'skipCache' save() option to avoid reloading data on new objects and adding them to the cache. (This will be used in syncing, where objects might be in another library where they're not needed right away.) Objects created with this option are instead disabled to prevent reuse. - Modified some tests to try to make sure we're reloading everything properly after a save. - Documented save() options
This commit is contained in:
parent
4792b7cd48
commit
a3f4fe181f
12 changed files with 113 additions and 145 deletions
|
@ -13,12 +13,10 @@ describe("Zotero.DataObjectUtilities", function() {
|
|||
yield Zotero.DB.executeTransaction(function* () {
|
||||
var item = new Zotero.Item('book');
|
||||
id1 = yield item.save();
|
||||
item = yield Zotero.Items.getAsync(id1);
|
||||
json1 = yield item.toJSON();
|
||||
|
||||
var item = new Zotero.Item('book');
|
||||
id2 = yield item.save();
|
||||
item = yield Zotero.Items.getAsync(id2);
|
||||
json2 = yield item.toJSON();
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue