Generally, don't clear the change state for primaryData when calling
loadPrimaryData() on an item that doesn't exist. Specifically, this
fixes an issue where calling loadPrimaryData() on a nonexistent item
after setting a libraryID and key would also clear any item type set in
the constructor. The same would apply for props set in the
Collection/Search constructors.
Make it easier to use the new `_changedData` approach to object
modifications (currently used only for `tags` and `deleted`) where
changed data is stored in a separate object rather than in the primary
variables. _getLatestField() can be used to return either the new
unsaved value or the current saved value.
Instead of showing warning button on toolbar
Otherwise if one person in a group upgrades to a beta with new fields,
everyone in the group will get a warning, even if they're already on the
latest release version. In a personal library, the user can upgrade to
the same version.
E.g., if a local item has been modified in a way that conflicts with a
remote item that also has a new, unknown field, don't show the CR
window -- just add the item to the sync queue and show the
some-data-could-not-be-downloaded error.
If an upload fails with a 412, and then we download, and then we go to
upload but there was nothing to upload (e.g., because the remote version
was chosen or there was an error saving it), there's no reason to do a
download again after that.
E.g., Actions menu in tag selector
Neither 'title' (HTML) nor 'tooltiptext' (XUL) works on HTML elements in
XUL documents, so add a mechanism to fake tooltip behavior and use it in
our Button component. This can be triggered by other React components if
necessary.
This is (mostly) mirroring Firefox tooltip behavior, which is a bit less
sophisicated than macOS behavior. If we end up using this for
everything, we can improve the behavior (e.g., start the delay when
entering the element, not when the mouse stops).
Fixes#1947
While we need to pass all items from descendant collections to
translators, only the immediate child collections of the selected
library or collection should be returned from Zotero.nextCollection().
I'm not sure how long we've been doing this wrong, but it resulted in
duplicated subcollections when round-tripping Zotero RDF. (TEI is the
only other translator that uses nextCollection(), so its exports were
probably similarly incorrect.)
https://forums.zotero.org/discussion/87135/export-import-creates-numerous-duplicate-subcollections
We're now flagging the DB for repair on startup errors, so if that fixes
the problem (e.g., because of our undiagnosed skipped-schema-update-step
problem), we'd still like to know about it.
But skip it at startup, even if flagged on, if there are schema update
steps to perform, to avoid creating tables that aren't expected to exist
yet.
Originally added in 5b9e6497a but disabled in c4cc44528 and 7a434df53
This lays the groundwork for moving collections and searches to the
trash instead of deleting them outright. We're not doing that yet, so
the `deleted` property will never be set (except for items), but this
will allow clients from this point forward to sync collections and
searches with that property for when it's used in the future. For now,
such objects will just be hidden from the collections pane as if they
had been deleted.
changedData is the new approach to updating DataObject data, storing the
new values in a separate object until save so that they don't actually
change the object unless the save goes through.
- Add DataObject._getLatestField() to return either the changed value or
the last-saved value
- Clarify that _markFieldChange() takes different values depending on
whether the field uses 'changed' or 'changedData'
- Fix bug calculating hasChanged() when a 'changedData' value is a
boolean