Commit graph

7473 commits

Author SHA1 Message Date
Dan Stillman
1ec2615eee More debug info for incomplete schema upgrades
Include info on whether the data directory is in a cloud storage folder
and whether the DB passes a quick integrity check.
2020-06-21 05:24:42 -04:00
Dan Stillman
b4320fbc4c Add Zotero.DB.quickCheck(), and speed up integrityCheck()
https://www.sqlite.org/pragma.html#pragma_quick_check

And limit both checks to 1 error (e.g., integrity_check(1))
2020-06-21 05:21:48 -04:00
Dan Stillman
3e8f0af583 Schema upgrade debugging
Include flags in repo update checks indicating whether a database table
that was previously supposed to be removed was removed and whether a new
table was created. This should help us figure out whether we can safely
perform schema update steps or whether we need to figure out why some
schema update steps aren't being applied.
2020-06-21 03:08:03 -04:00
Adomas Venčkauskas
42ac976f1e Do not attempt to update bibliography when no citations are present 2020-06-18 16:13:47 +03:00
Dan Stillman
68ec841f35 Warn on "Box" in data directory path 2020-06-14 17:15:12 -04:00
Dan Stillman
bccf5ff0b2 Fix endless WebDAV loops if server has wrong mtimes but hash matches
Possibly caused by a third-party client uploading mtimes that then
aren't synced, or that differ from what get synced. When we detect this,
try to correct it by updating mtimes on WebDAV and the API to match the
local file.

https://forums.zotero.org/discussion/83554/zotero-loop-syncs-2000-items
2020-06-09 01:26:11 -04:00
Dan Stillman
a8c682bf4b Preserve linked-object and replaced-item relations when merging items
https://groups.google.com/d/msgid/zotero-dev/6f764822-ed7c-46eb-8068-ce9ed1a1538c%40googlegroups.com

Regression from 617564982c
2020-06-06 17:16:09 -04:00
Dan Stillman
bb220ad0f2 Update to citeproc-js 1.3.22 2020-06-02 17:07:31 -04:00
Dan Stillman
b2e902746a Strip HTML tags from titles when generating filenames 2020-06-02 17:06:42 -04:00
Dan Stillman
13349df380 strToDate(): More boring way of fixing 0620b16d3e 2020-05-28 06:38:39 -04:00
Dan Stillman
0620b16d3e strToDate(): Don't parse 01/01/08 as the year 8
Regression from b7dc0d8b0a (5.0.81)
2020-05-28 06:19:42 -04:00
Dan Stillman
c882488ef7 Add "(APA)" and "(ASA)" to style list in Document Preferences
Hopefully this will help people not select ASA 6th when they're looking
for APA 6th.

https://forums.zotero.org/discussion/comment/357135/#Comment_357135
2020-05-28 06:19:41 -04:00
Dan Stillman
b0fd7adcbe Ignore useDataDir pref if no dataDir pref 2020-05-28 04:35:14 -04:00
Dan Stillman
85bc5d168e strToDate(): Fix 'order' for just a number <=12
"m" instead of "m y"
2020-05-28 04:35:14 -04:00
Dan Stillman
f43df90225 Fix applying remote deletion of item in collection in read-only library
"Cannot edit item in read-only library"

I have no idea how this bug has gone undetected for so long.
2020-05-26 08:23:18 -04:00
Dan Stillman
b288a278d8 Warn if data directory is in iCloud Drive 2020-05-26 03:11:43 -04:00
Dan Stillman
c65322d0a4 Clarify warnings about data removal when switching accounts
And improve styling of hardConfirmationDialog.xul

Closes #1359
2020-05-23 03:23:32 -04:00
Dan Stillman
1e0ad3aba3 Restore corrupted-database detection during SQL queries
Show a popup if DB corruption is detected with a warning to avoid
storing the data directory in cloud storage, a link to a support page
with more information, and a button to restore from the last automatic
backup.

Also show the warning about cloud storage again after restoring from the
last automatic backup.
2020-05-22 04:46:58 -04:00
Dan Stillman
30cefca18e Fix cross-library collection dragging from read-only library
This has apparently always been broken.
2020-05-20 08:45:37 -04:00
Dan Stillman
a086507167 Obey Cmd/Ctrl-W in Scaffold, Style Editor, and Run JavaScript windows 2020-05-17 04:08:43 -04:00
Dan Stillman
c9e90417ee Improve zotero://open-pdf handling
- Support Adobe Acrobat on macOS, with page number support via System
  Events. Tested with Acrobat Reader, but hopefully functional with
  non-Reader versions as well
- Use full path to configured .app via AppleScript rather than a
  hard-coded name, in case there are multiple versions on the system
- Simplify code and improve logging
2020-05-16 02:04:16 -04:00
Dan Stillman
6676ece3e4 Add 'pcloud' to dangerous data directories
It seems like pCloud can sync arbitrary directories as well, but at
least some people use "pCloud Drive".
2020-05-15 19:26:24 -04:00
Dan Stillman
c5783f093a Add missing 'www' to support URL 2020-05-15 19:24:45 -04:00
Dan Stillman
2d720b9532 Scaffold: Clarify error parsing tests 2020-05-15 19:24:20 -04:00
Dan Stillman
2e50d37ebb Translator tester: reduce defer delay from 20s to 5s
This seems like it would be sufficient for most tests that need to wait
for a page to load and is much less annoying in Scaffold. We could
adjust for automated runs if those end up using a browser again.
2020-05-15 19:21:40 -04:00
Dan Stillman
4068dffc0f Scaffold: Use loadDocuments() for tests and honor defer: true
Previously, while updating a test used loadDocuments() (for a real
browser load) and honored `defer: true`, running a test did not.

This updates Zotero_TranslatorTester to use loadDocuments() when run in
Zotero. In other environments (translation-server, connector), it will
continue to use processDocuments(), which is based on XHR.

Fixes zotero/scaffold#96
2020-05-15 19:21:40 -04:00
Dan Stillman
0341b8e99a HTTP.loadDocuments(): Create cookie sandbox automatically if not provided
This prevents use of the internal cookie store.
2020-05-15 19:21:40 -04:00
Adomas Venčkauskas
d0db9cbadf Attempt to catch/log initialization errors for the citation dialog 2020-05-15 10:30:40 +03:00
Dan Stillman
6d2e843f50 Fix "params.join is not a function" in DB.queryAsync() error logging
If a query failed and `params` wasn't an array, the "params.join is not
a function" would be thrown rather than a proper error.
2020-05-12 03:50:43 -04:00
Dan Stillman
0199428c57 Fix error migrating Extra with empty author in citeproc-js cheater syntax
E.g., `{:author: }`

https://forums.zotero.org/discussion/83070/error-report-id-n-a-there-was-an-error-starting-zotero
2020-05-12 01:00:21 -04:00
Dan Stillman
849d52f1bb Update submodules 2020-05-09 03:20:53 -04:00
Dan Stillman
ac19cbbc40 Fix tag selector not showing child item tags in "Title, Creator, Year" mode
Regression from 5.0.83. This reverts 4290f26d7c.

https://forums.zotero.org/discussion/82564/tag-management
2020-05-03 20:07:14 -04:00
Dan Stillman
cece56af79 Warn when data directory is in Google Drive or OneDrive
In addition to Dropbox

There might be others we should add. (E.g., can we detect when
Desktop/Documents is in iCloud on a Mac?)

Closes #1373
2020-04-29 04:42:42 -04:00
Dan Stillman
7c3faeb58d Don't allow setting data dir to 'storage' or linked attachment base dir
If 'storage' (with a zotero.sqlite file above it) is chosen, offer to
use parent instead.

Addresses #538
2020-04-29 04:42:42 -04:00
Dan Stillman
40fe85b274 Prevent setting base directory within data directory
Addresses #538
2020-04-29 04:42:42 -04:00
Adomas Venčkauskas
30d40d6094 Add some temporary logging for Mac users getting empty citation dialog
https://forums.zotero.org/discussion/82697/empty-citation-dialog-after-clicking-add-edit-citation-on-an-existing-citation
2020-04-23 11:40:16 +03:00
Dan Stillman
2c046a227b Fix sync error on collection/search conflict
> Invalid data error for collection [key] in [library]: Unknown
> collection property 'dateAdded'"

Regression from 4b60c6ca27, probably
2020-04-23 03:56:14 -04:00
Dan Stillman
f531ac7b60 Fix error dialog display if attachment couldn't be renamed
Regression from 56dcd6da26 (2016)
2020-04-22 00:13:52 -04:00
Dan Stillman
53a1722a69 Throw explicit error if no type in itemFromCSLJSON() 2020-04-22 00:11:12 -04:00
Dan Stillman
81e2bee452 Fix 'false' filename after case-only rename on Macs
Zotero.File.move() now forces `overwrite` if the old and new filenames
differ only by case, since otherwise on a case-insensitive filesystem
OS.File.move() does an existence check and thinks that the target file
exists.
2020-04-22 00:01:28 -04:00
Dan Stillman
595ba396ef Fix invalid relations from copying invalid feed item to collection
Prior to fdfa8052d1, it was possible to create an item in a feed
library using Add Item by Identifier. If you did that, and then copied
it to a collection in your personal library, it would somehow end up
with an owl:sameAs relation to a `/users/local` URI (probably because
the URI functions don't work properly on a feed library).

This will clean up such relations in a schema update.
2020-04-17 05:42:21 -04:00
Dan Stillman
fdfa8052d1 Disable toolbar buttons properly in read-only views
Most importantly, don't allow Add Item by Identifier to create an item
in a feed library...

The other buttons didn't do anything but still showed an effect on
mousedown, which this prevents.
2020-04-17 03:07:25 -04:00
Dan Stillman
e406e04f5c Resolve schemaUpdatePromise even if repository returns 500 at startup
If repo.zotero.org returned a 500 during Zotero startup, translators and
styles wouldn't be initialized until a 200 was returned, and various
things that depended on translators or styles wouldn't work in the
meantime. Now a single retry is made after 5 seconds, and if that fails
the promise is resolved regardless.

Regression from dc60e5f840, which added automatic 5xx retrying to
Zotero.HTTP.request()
2020-04-17 02:11:27 -04:00
Dan Stillman
ad13313924 Don't change existing sync cache object on 'unchanged' response
Previously, if an object was uploaded but the API returned 'unchanged',
the uploaded data would be written to the sync cache, which, given that
most requests are patch requests, could result in an empty or mostly
empty object being saved to the sync cache. That would cause the next
sync to treat most/all local fields as changed and either upload them
unnecessarily or trigger a conflict instead of merging changes
automatically.
2020-04-14 05:07:50 -04:00
Dan Stillman
083588e211 Save correct data to cache when merging non-conflicting sync changes
When non-conflicting changes were automatically merged, the local object
would be correctly marked as unsynced, but the merged object rather than
the remote object would be saved to the sync cache. When the object was
then uploaded, it matched the cache version exactly, so an empty patch
object (other than an unchanged dateModified, which is always included)
would be uploaded and the local change wouldn't make it to the server.
The empty patch would result in an 'unchanged' response, which would
cause the empty patch object to be saved to the sync cache (which is a
bug that I'll fix separately). If the local object was modified again,
the patch would include all fields (since the cache object was empty)
and the local change would be uploaded, but there could also be
unnecessary conflicts due to it looking like all local fields had been
modified.

This patch causes the remote object to be saved to the sync cache
instead, so the local change looks like a local edit and is correctly
uploaded.
2020-04-13 03:42:28 -04:00
Dan Stillman
617564982c Include only related-item relations when duplicating items
Don't include linked-object or replaced-item relations. Previously, if
you duplicated an item, modified it to represent a different source, and
dragged it to another library where you had already copied the original
item, the new item wouldn't be transferred.

https://forums.zotero.org/discussion/comment/353246/#Comment_353246
2020-04-13 01:31:21 -04:00
Dan Stillman
c5a4871a6a Set freshwater-science to capitalize the first word of subtitles
https://forums.zotero.org/discussion/comment/352212/#Comment_352212
2020-04-13 01:31:06 -04:00
Dan Stillman
3d3c90215d Fix situation where all items list columns can become enabled 2020-04-10 15:56:37 -04:00
Dan Stillman
8a0e81d6f6 Properly require integrity check on nested collection detection
When expanding to a collection reveals an infinite loop

Bug in 0679809735
2020-04-09 02:17:37 -04:00
Dan Stillman
90b393ed79 Fix Shift-drag/Cmd-drag to tag selector to remove tags
Apparently we implemented this 5 years ago in #873 and then broke it
(with the move to React, I think) without ever announcing it as a new
feature in Zotero 5? Anyway, this restores it, using Cmd on macOS (the
same as for moving vs copying items, or files in Finder).
2020-04-08 03:58:10 -04:00