Commit graph

9 commits

Author SHA1 Message Date
Dan Stillman
b79ecfb5fe Temporarily disable test for non-integer getAsync() 2017-06-05 03:00:15 -04:00
Dan Stillman
2237c71dcb Fix test for invalid id passed to DataObjects.getAsync() 2017-01-17 04:18:39 -05:00
Dan Stillman
ab4138cf26 Don't throw in Zotero.DataObjects::get() for nonexistent objects
Return false for single ids or skip for multiple ids. This is the original
behavior, but at some point it started throwing an UnloadedDataException. IDs
are always loaded at initialization, though, so we know whether the objects
actually exist.
2016-05-05 06:36:24 -04:00
Dan Stillman
0d59bde186 Clean up DataObject erasing, and fix search unloading 2015-06-16 19:51:21 -04:00
Dan Stillman
420985661b Default to user library when assigning unsaved item to collection
And fix some issues setting the libraryID property on unsaved objects

Also return .deleted as false, not an empty string
2015-05-31 02:03:53 -04:00
Dan Stillman
bf1ee0d52b Move getLibraryAndKeyFromID() tests to dataObjectsTest.js 2015-05-24 22:14:52 -04:00
Dan Stillman
abaa4da5ab Much better data object change detection
Replace Z.DataObjects::diff() with Z.DataObjectUtilities.diff(). Instead
of just returning two objects with the differing fields, the new diff()
generates a changeset with operations to apply with applyChanges(),
including at the array member level for collections and tags. This,
combined with cached pristine copies of objects, will allow for vastly
better conflict resolution, with automatic merging of non-conflicting
changes.

Creators currently don't show granular changes, and ordering might make
it too tough to do so. Relations diffing isn't yet implemented.
2015-05-19 01:17:12 -04:00
Dan Stillman
f727b224e7 Fix tag diffing 2015-05-15 01:47:20 -04:00
Dan Stillman
1558ed8a27 Update Zotero.DataObjects.prototype.diff() to handle API JSON 2015-05-12 19:51:02 -04:00