Commit graph

607 commits

Author SHA1 Message Date
Dan Stillman
80a0826eb6 Add archived group handling to sync runner
- Archive remotely missing that user chooses to keep
- Ignore archived groups that don't existing remotely
- Unarchive groups that become available again
2017-02-24 02:36:18 -05:00
Dan Stillman
9ac458e05c Add 'archived' property to Zotero.Library objects
Set when a user loses access to a library but chooses to keep it as a
read-only library.
2017-02-24 02:36:18 -05:00
Dan Stillman
88184b341b Setting a library's 'editable' to false should do same for 'filesEditable' 2017-02-24 02:36:18 -05:00
Dan Stillman
74d1cc193a Check database values in Zotero.Library#editable tests 2017-02-24 02:36:18 -05:00
Dan Stillman
f7074a75b5 Fix error deleting selected library 2017-02-24 02:36:17 -05:00
Dan Stillman
383eac4657 Use same directory for OS.File.moveAtomic() temp file
Using the main temp directory was causing writes to fail when storage
was on another filesystem.
2017-02-22 19:53:48 -05:00
Dan Stillman
0964277a37 Use OS.File.move() for data-dir migration on Windows, and make automatic
Previously on Windows, where we don't have /bin/mv, we were recursing
into the data directory and copying files individually, which is very
slow, so automatic migration was disabled. Instead, try moving
directories with OS.File.move() with the `noCopy` flag. Moving
directories is technically unsupported by OS.File, but probably only
because of the possibility of a cross-volume copy (which is only
implemented for some platforms), and using `noCopy` hopefully prevents
that. If someone does have their data directory or storage directory on
a different volume, the migration might be quite slow, but leaving a
data directory behind in the Firefox profile directory (where it can be
easily misplaced with a seemingly unrelated Firefox reset) is worse.
2017-02-22 04:56:49 -05:00
Dan Stillman
3c5912f68d Merge pull request #1180 from adomasven/fix/savePage-no-translator 2017-02-21 16:40:33 -05:00
Adomas Venčkauskas
01df8f59e5 Default to first translator for /connector/savePage if not provided 2017-02-21 16:40:10 -05:00
Dan Stillman
333675d8ea Don't select sibling on attachment removal if attachment was unselected
Fixes #1173
2017-02-21 01:21:07 -05:00
Dan Stillman
60b2e16746 Fix "Item collection [n] not found" error after deleting collection 2017-02-21 00:38:00 -05:00
Dan Stillman
64d73cf2d0 Fix handling of old-style 'condition'/'savedSearch' conditions
Strip library id prefix in addCondition() and _loadConditions(), so the
internal code can always expect just a key.
2017-02-21 00:04:53 -05:00
Dan Stillman
d32f23471e Fix setting of libraryID in createDataObject() support function
When another property was also set, setting libraryID would fail.
2017-02-21 00:04:53 -05:00
Dan Stillman
5c50bb00cf Don't save full-text cache files for linked files to linked directory
Regression from 80f888f374. Not entirely sure what I was trying to fix there.
2017-02-20 17:51:37 -05:00
Dan Stillman
bb0fa73899 Fix old-style 'collection' condition for My Library in saved searches 2017-02-18 14:19:30 -05:00
Dan Stillman
07ea9dae84 Merge pull request #1172 from adomasven/fix/clean-authors
Get a better last name if current guess starts with weird symbols
2017-02-18 12:52:45 -05:00
Adomas Venčkauskas
bf1c52a5fd Get a better last name if current guess starts with weird symbols 2017-02-18 18:12:24 +01:00
Dan Stillman
058a4b1593 On 404 from ZFS upload, mark attachment item for upload
This shouldn't happen, but reported here:

https://forums.zotero.org/discussion/64386/5-0-beta-persistent-sync-errors

Possibly the same cause as this:

https://forums.zotero.org/discussion/64438/5-0-beta-persistent-sync-error
2017-02-16 20:11:05 -05:00
Dan Stillman
34c90fd156 If parent item is missing remotely, mark as unsynced and add to queue
This shouldn't happen, but there've been some reports of it.
2017-02-16 18:05:48 -05:00
Dan Stillman
bb665a56b6 Fix firstCreator for unsaved items
Necessary when editing embedded citations that don't exist in library
2017-02-15 23:15:00 -05:00
Dan Stillman
3830aa1125 Mark trashed items as unsynced and update parents (including note list)
Regression from 3a0e0cb088
2017-02-15 14:22:34 -05:00
Dan Stillman
0570c2edc7 Fix test failure after 27cb099c82
Attachments are now saved before the connector server responds, because they're
no longer started out-of-band in saveItems(). This is necessary to prevent
transaction badness during imports, but it may not be what we want for the
connector, so we may want to revisit this after further testing.
2017-02-09 02:29:24 -05:00
Dan Stillman
3a0e0cb088 Drastically speed up moving items to the trash
E.g., moving 3,600 items to the trash now takes 4 seconds instead of 62

Instead of saving each item, update internal state and database directly
(which is more brittle but worth it). Also avoid unnecessary sorting
after removing an item from the items tree.
2017-02-08 23:42:55 -05:00
Dan Stillman
12ad749087 Fix additional file sync error with no remote stored hash
Follow-up to c9694e93b0
2017-02-08 14:12:16 -05:00
Dan Stillman
55e9a0ee35 Update empty state of parent collection when deleting subcollection 2017-02-03 01:18:00 -05:00
Dan Stillman
1a49018bdc Fix moving items between collections
`mozSourceNode` seems to no longer be set in `dataTransfer` objects
during drags, so we now store it in `Zotero.DragDrop`.
2017-02-03 00:07:16 -05:00
Dan Stillman
f98de97e4d Don't select last item in list when item is removed from collection 2017-02-03 00:07:16 -05:00
Dan Stillman
48a81e3b46 Fix 412 after choosing local file on file conflict 2017-01-29 07:50:46 -05:00
Dan Stillman
4d56191f0c Fix importing of files using relative paths 2017-01-27 20:51:12 -05:00
Dan Stillman
aec9b2a531 Automatically use remote version when two items in trash are in conflict 2017-01-26 18:07:01 -05:00
Dan Stillman
e23452363b Handle auto-hyphenated ISBN during item conflict
Always keep the hyphenated version, and don't consider it a visible conflict
2017-01-26 15:08:34 -05:00
Dan Stillman
a43f9d16ac Allow number or name for translator type in buildDummyTranslator()
This reverts c6b78da69d, which changed it to expect numbers when I
noticed the type being undefined in debug output, but apparently the
only tests where the type actually mattered passed it as a name.

At some point we should just change all tests to pass as a name.
2017-01-23 09:13:44 -05:00
Dan Stillman
c6b78da69d Fix translatorType in dummy translators in tests 2017-01-23 07:02:08 -05:00
Dan Stillman
c9694e93b0 Fix file upload error when remote attachment has no stored hash 2017-01-22 15:30:18 -05:00
Dan Stillman
90a3013802 Disable script run time warning in tests 2017-01-21 06:37:44 -05:00
Dan Stillman
9b247ebba7 Fix error trying to generate report for many items
When adding many search conditions (e.g., when matching many items with the
`key` condition), the query can fail due to either the bound parameter limit or
the expression tree size limit.

To avoid this, add support for an 'inlineFilter' property on search conditions
when using the 'is' or 'isNot' operator. 'inlineFilter' is a function that
returns a quoted value suitable for direct embedding in the SQL statement, or
false if not valid. Multiple consecutive conditions for the same 'inlineFilter'
field are combined into an `IN (x, y, z)` condition.
2017-01-21 03:38:36 -05:00
Dan Stillman
362e18c747 Fix attachment content search
And always convert ids from GROUP_CONCAT() to integers in search code.
2017-01-19 13:32:29 -05:00
Dan Stillman
2237c71dcb Fix test for invalid id passed to DataObjects.getAsync() 2017-01-17 04:18:39 -05:00
Dan Stillman
a017fe6666 Fix Zotero.Date methods within translator sandbox
Only a few methods are imported, so some of the changes in 7bdcc17ed
have to be reverted.
2017-01-17 02:23:15 -05:00
gracile-fr
695cb9583a Amend short form of French months (continuing #64)
The Firefox French language pack contains some mistakes regarding
the short form of months. As a consequence, French month parsing
didn't work.

Please note that these values aren't even the correct abbreviations
but only the three or four first letters of the correct abbreviations.
See the French CSL locale for the correct abbreviations.
2017-01-16 18:58:59 +01:00
Dan Stillman
f2440eb826 Fix passing file: URI to Zotero.File.getContentsAsync() 2017-01-14 17:20:39 -05:00
Dan Stillman
ef1ff8bc42 Fix #64, Non-English month parsing doesn't work in Standalone
Month values from the Firefox language packs are included in a
JSON file used by `Zotero.Date.getMonths()`. `getMonths(true)` includes
English months as well.

The JSON file should be bundled with the connectors as well, and
Zotero.Date.init() should be updated to populate the month data from
that.
2017-01-09 04:47:23 -05:00
Dan Stillman
a076edc836 Update some deprecated function calls 2016-12-29 21:50:33 -05:00
Dan Stillman
9ffab20a09 Add option to Zotero.Utilities.ellipsize() to truncate at word boundary 2016-12-29 04:01:00 -05:00
Dan Stillman
ab959cd858 Fix "Reset File Sync History" 2016-12-22 10:00:40 -05:00
Dan Stillman
a9a54ed21c Set API URL via pref for download-on-demand test 2016-12-21 08:23:31 -05:00
Dan Stillman
205bab7b89 Fix Travis failure after skipped test
Apparently after() is run even if a test is skipped
2016-12-21 05:28:48 -05:00
Dan Stillman
4b602ed26c Disable all recognizePDF tests in Travis 2016-12-18 09:18:57 -05:00
Dan Stillman
6994c63a0e Tweak recognizePDF fix, add test coverage, and enable manual tests
Still disabled in Travis until we mock the remote services
2016-12-17 08:05:33 -05:00
Dan Stillman
238ab80699 Add -s flag to runtests.sh to start at given file
Useful for restarting after spurious errors when using -f

E.g., ./runtests.sh -s syncEngine
2016-12-16 04:21:37 -05:00