Commit graph

8666 commits

Author SHA1 Message Date
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
da529d0d39 Update locale strings from Mozilla language packs 2020-04-16 15:48:54 -04:00
Dan Stillman
e9065654f7 Fix Edit → Preferences not appearing in br and gl-ES locales
(And mn-MN, but that's not an active locale.)
2020-04-16 15:39:34 -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
36afe4573f Fix item selection from timeline 2020-04-11 14:57:32 -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
Dan Stillman
5bb2486040 Fix Shift-Tab in Title and Extra fields
Fixes #1806
2020-04-07 04:04:37 -04:00
Dan Stillman
ffa2a8d9be Don't crash when clicking on a note link with an unknown scheme 2020-04-06 04:52:37 -04:00
Dan Stillman
e9ea9ae171 Leave Event Place and Publisher Place in Extra on import
These CSL variables are both currently mapped to the Zotero Place field,
but that's imprecise and will change:

https://github.com/citation-style-language/zotero-bits/issues/6

So for now, don't convert these to a Place line or make them eligible
for migration to a real field (once we turn that on).

https://groups.google.com/d/msgid/zotero-dev/806a22e3-3d6a-4d86-8747-10c787291a93%40googlegroups.com
2020-04-04 04:17:51 -04:00
Dan Stillman
0e3d707576 Remove a couple redundant lines in Extra on RDF import
`publicationTitle`/`reporter` (and fields mapped to `publicationTitle`)
and `meetingName`/`conferenceName`

I assume these should just be base-field mappings, but since they're
not, they're not automatically deduplicated in `fromJSON()` and need to
be handled separately.

https://groups.google.com/d/msgid/zotero-dev/806a22e3-3d6a-4d86-8747-10c787291a93%40googlegroups.com
2020-04-04 04:17:27 -04:00
Dan Stillman
91ca6d2ba6 extraToCSL(): Fix "zoteroField[1] is undefined" on single-character field
E.g., "a:" on a line

https://forums.zotero.org/discussion/82286/new-line-in-extra-field-induces-error-during-bibliography-generation
2020-04-03 18:13:10 -04:00
Dan Stillman
9919090901 Add English strings from connector 2020-04-01 16:18:15 -04:00
Dan Stillman
c22b6ae68a Fix crash dragging open tag selector if closed at startup 2020-03-28 23:50:30 -04:00
Dan Stillman
97767278fb Load all item data types before migrating Extra fields on schema update
https://forums.zotero.org/discussion/82153/beta-startup-error
2020-03-27 02:00:28 -04:00
Dan Stillman
17d6181507 fromJSON(): Fix bug in 02c5510710 2020-03-24 18:25:53 -04:00
Dan Stillman
ad9604e267 Don't use 'dialog=no' or 'modal' for preferences window
Since at least 2009, for reasons unclear, we've used `dialog=no` when
`instantApply` is true (macOS/Linux) and `modal` (with implicit
`dialog=yes`) when false (Windows). `dialog=no` doesn't seem to have an
effect on macOS, and `modal` doesn't seem to have an effect on Windows
(at least with `openDialog()`), but on Linux `dialog=no` allows the
dialog to be resized, which it shouldn't be, and causes problems with a
tiling window manager. This change switches to the implicit `dialog=yes`
on all platforms. (On Linux, this also centers the dialog on the screen,
keeps it in front of other windows, and does a weird opening animation.)

https://forums.zotero.org/discussion/82050/zotero-preferences-window-issue-with-tiling-window-managers
2020-03-24 17:38:14 -04:00
Dan Stillman
0f212bdd76 Use modal dialog for import wizard and queue notifier updates
This should dramatically improve import speed for large imports by
delaying UI updates until the import finishes.

Additional Zotero.Attachments methods now support `saveOptions` to
support `notifierQueue`.
2020-03-24 16:02:17 -04:00
Dan Stillman
c62e725e2a Embed ids directly in Tags.getAllWithin() SQL to avoid parameter limit 2020-03-24 14:50:31 -04:00
Dan Stillman
679148d8d6 Don't store "Version Number" in Extra for books coming from RDF
The RDF translator assigns 'versionNumber' in addition to 'edition'.
2020-03-24 14:48:09 -04:00
Dan Stillman
02c5510710 Item.fromJSON(): Skip warnings for redundant invalid fields 2020-03-24 14:47:23 -04:00
Dan Stillman
0b7f5fef83 Re-enable Extra field migration on schema update 2020-03-24 14:13:21 -04:00
Dan Stillman
c03b9c2733 Leave ignored 'type:' in Extra (regression from 52d5b6856) 2020-03-23 19:06:49 -04:00
Dan Stillman
0278810cb5 Fix radioBroadcast/tvBroadcast CSL-JSON round-trip after 52d5b68564
'podcast' is now the first mapped type for 'broadcast', per
https://forums.zotero.org/discussion/comment/351113/#Comment_351113, so
we need to check for fields not available in 'podcast'. 'radioBroadcast'
will be converted to 'tvBroadcast' on re-import, but that was the case
before.
2020-03-23 17:22:45 -04:00
Dan Stillman
48e39d9bd8 Update submodules 2020-03-23 16:25:48 -04:00
Dan Stillman
d95b507ea0 Update locales from Transifex 2020-03-23 16:05:26 -04:00
Dan Stillman
52d5b68564 Update 'type:' handling when migrating Extra lines
- When changing type based on 'type:' line, move existing fields that
  are no longer valid to Extra
- Remove 'type:' line with CSL type if the item's existing type is one
  of the types mapped to it
2020-03-22 15:19:24 -04:00
Dan Stillman
9d330206ed Remove unnecessary part of 58c2e38ec2
getAllAddons() waits for extensions to be initialized, so the code in
Prefs::loadExtensionDefaults() to delete an extensions.json with an
AppTranslocation path should be sufficient, and it shouldn't be
necessary to check for it after showing the AppTranslocation startup
error.
2020-03-21 00:56:55 -04:00
Dan Stillman
58c2e38ec2 Fix invalid integration plugin installations on macOS
If a Mac user first starts Zotero from the disk image, Zotero
shows an error telling them to install the app in Applications, but the
integration plugins will have already be registered in extensions.json
with paths to the temporary AppTranslocation directory. This meant that
the next time the user restarted their computer (or sooner), the AppTranslocation
directory would be cleared and the integration plugins would no longer
be loaded.

This deletes extensions.json if it contains an AppTranslocation path for
an extension when the app is started from the disk image, which should
prevent this going forward. For existing users experiencing this, it
also checks installed extensions at startup for AppTranslocation paths
and deletes extensions.json if any appear.
2020-03-20 16:18:02 -04:00
Dan Stillman
e6453b2088 Parse single tab-delimited creator
And fix logged error when adding empty creator with just whitespace
2020-03-19 10:24:03 -04:00
Dan Stillman
c26ffedf9f Disable Extra field migration on schema upgrade for now
I enabled this by mistake in 3129f3580
2020-03-18 18:00:57 -04:00
Dan Stillman
8cd04e5d91 Temporarily disable the fix from 3247391914
Disable this until we figure out why it was running when migrating from
Extra.
2020-03-17 22:16:00 -04:00
Dan Stillman
3f2998bb6b Don't extract 'type: note' or 'type: attachment' from Extra 2020-03-17 13:50:45 -04:00
Dan Stillman
3247391914 Fix removal of creators when changing to item type without creators
This shouldn't actually be used currently, since only notes and
attachments lack creators and it shouldn't be possible to change regular
items into notes or attachments.
2020-03-17 13:14:58 -04:00
Dan Stillman
c4aad9a041 Better logging for Extra migration 2020-03-17 11:57:18 -04:00
Dan Stillman
275e17c7ec Fix broken Edit menu in Galego locale 2020-03-17 10:35:43 -04:00
Dan Stillman
dd9ec54c3b Don't try to migrate Extra fields in read-only libraries 2020-03-15 19:52:56 -04:00
Dan Stillman
23c936f016 Fix creator migration from Extra 2020-03-15 13:51:04 -04:00
Dan Stillman
982bcff357 Don't log "Unknown browser" for requests from Safari App Extension 2020-03-14 18:18:45 -04:00
Dan Stillman
c3e390eb5a Fix more breakage in 067980973 2020-03-14 03:29:56 -04:00
Dan Stillman
ad6c3f7a09 Fix test failures due to rapid attachment note initialization
81739c7a66 prevented new windows from working after a restart error,
and full-text tests (and possibly others) create attachments quickly in
a way that was causing init callbacks to receive a TinyMCE editor with
missing functions (possibly because they were already removed?). This
just ignores those errors, which isn't a great solution, but it probably
won't happen in real use, so let's see if it works.
2020-03-14 02:46:47 -04:00
Dan Stillman
440b65935e Fix breakage in 067980973 2020-03-13 22:06:10 -04:00
Dan Stillman
0679809735 Fix invalid collection nesting in DB integrity check
It shouldn't be possible to nest two collections inside each other, but
if it happens, fix it in the integrity check.

Also detect it from CollectionTreeView::expandToCollection() (used when
showing the collections containing an item) and crash Zotero with a flag
to run an integrity check after restart. Previously, this would result
in an infinite loop.

This may be the cause of some of the collection disappearances people
have reported. If parentCollectionID never leads to a null, the
collection won't appear anywhere in the tree.

TODO:

- Figure out how this is happening
- Detect and fix it automatically for people it's happened to
2020-03-13 18:07:20 -04:00
Dan Stillman
81739c7a66 Add Zotero.crash() to show restart message in every window 2020-03-13 17:47:01 -04:00
Dan Stillman
9175f9ade8 Don't use "Create Bib" locale for Quick Copy when no explicit locale set
If you'd never set a Quick Copy locale, the option would show as using
the current locale, but Quick Copy itself would use the last locale from
"Create Bibliography from Items". That was a side effect of behavior we
put in place in 2015 so that documents created before 4.0.27 that relied
on the removed bibliographyLocale pref would continue using the migrated
locale, but now that we've had an explicit locale option for years in
the document preferences I think we can stop doing that.
2020-03-13 17:06:29 -04:00
Dan Stillman
3129f35804 Limit HTTP status override to certain invalid HTTP responses
Only NS_ERROR_INVALID_CONTENT_ENCODING for now

For example, it shouldn't swap in a 403 on
NS_ERROR_PROXY_CONNECTION_REFUSED, as it was doing previously.

https://forums.zotero.org/discussion/81864/syncing-error
2020-03-11 08:53:13 -04:00
Dan Stillman
b0de59fe89 Fix OPML import (regression from 5.0.78) 2020-03-09 22:46:03 -04:00
Dan Stillman
2acec4184a Use process id instead of bundle identifier to activate Mac app
This prevents a second copy of Zotero from being launched if you're
running the Zotero beta and click on a word processor plugin button
while a dialog is already open.
2020-03-09 20:17:09 -04:00
Dan Stillman
6e38c36804 Don't update Extra field if missing in fromJSON()
Harmless regression from recent changes
2020-03-09 01:19:52 -04:00
Dan Stillman
d389a71280 Download remotely updated files in "as needed" file sync mode
Previously, files updated remotely wouldn't be downloaded in "as needed"
mode if a copy of the file already existed locally and could only be
re-downloaded by deleting the file via Show File.

This causes remotely modified files that exist locally to be downloaded
at sync time, even in "as needed" mode, by marking them as
"force_download". While this might not be ideal for people who use "as
needed" to limit data transfer, it's better for people who use it simply
to limit local storage, and ending up with an outdated file while
offline seems worse than a little bit of extra data transfer.

In the future, we'll likely also provide ways to explicitly download and
remove files, so keeping chosen files in sync makes sense.

Files modified remotely before this change (which were marked as
"to_download" instead of "force_download") won't be downloaded as sync
time in "as needed" mode, but they'll now be re-downloaded on open.

Fixes #1322
2020-03-09 01:19:52 -04:00
Dan Stillman
76a1535a60 Full-text indexing improvements
- Use full-text cache file from syncing if available when reindexing via
  info pane or Rebuild Index → Index Unindexed Items. Only discard it for
  full index rebuild. This allows Index Unindexed Items to be used to
  force immediate processing of queued content from syncing and avoids
  unnecessary syncing back of identical content. Previously, the cache
  file was used for a manual index only when the local file didn't exist.
- When rebuilding index, don't clear indexed items with missing local
  file that are missing stats due to a pre-411180ef bug.
- indexItems() now takes an 'options' object as its second parameter
- Minor code cleanup
2020-03-09 01:19:52 -04:00
Dan Stillman
411180ef83 Full-text indexing fixes
- Don't clear item's index stats (and show "Unknown") when an item is
  reindexed remotely and the content matches the local content
- Always update an item's state and its stats in the same query, to
  avoid incorrect feedback immediately after indexing
- Clean up `setItemContent()` tests
2020-03-06 03:11:16 -05:00
Dan Stillman
2645f0de12 Fix "extra is null" error (also fixed via API) 2020-03-03 00:23:38 -05:00
Dan Stillman
da5e8c549e Convert Zotero fields in Extra to CSL fields for citeproc-js 2020-03-02 01:38:10 -05:00
Dan Stillman
83cc65eea6 Fix parsing of CSL date fields in extractExtraField() 2020-03-02 01:34:27 -05:00
Dan Stillman
78b5dbaca1 Update locales from Transifex 2020-02-29 16:38:13 -05:00
Dan Stillman
691d0ca9d1 Allow saved searches to be edited or deleted on error
E.g., "too many SQL variables"

Fixes #1734
2020-02-29 16:38:13 -05:00
Dan Stillman
8170cf09de Fix Editor sorting with >1 editor
Follow-up to eec0f00784
2020-02-26 14:45:48 -05:00
Dan Stillman
e51a229e54 Update locales from Transifex 2020-02-24 13:25:50 -05:00
Dan Stillman
8822982199 Fix drop-downs in timeline (regression from 5.0.78)
Fixes #1773
2020-02-24 13:16:31 -05:00
Dan Stillman
b7901ec8dc Add "English (Canada)" to locales menu
en-CA is now a valid locale after zotero-standalone-build@46f3da068
(though the use of ISO date strings is the only difference).
2020-02-23 21:35:56 -05:00
Brenton M. Wiernik
479edcb68a Change label for Computer Program to Software
https://forums.zotero.org/discussion/81522/add-video-game-as-a-source#latest
2020-02-22 13:20:27 -05:00
Dan Stillman
a9dee2f487 Item::fromJSON(): Remove invalid-for-type Type-mapped fields
"Type: [val]` in Extra means Item Type to citeproc-js, and Type values
from translators mostly aren't going to be useful if the item type
doesn't have a Type-mapped field.

https://forums.zotero.org/discussion/comment/348864/#Comment_348864
2020-02-17 11:39:35 -05:00
Dan Stillman
b2bf60e1d7 Item.fromJSON(): Dedupe invalid-for-type fields when storing in Extra
3de54455f6 removed redundant base-mapped fields when a valid-for-type
field was also set, but that still left duplicate fields in Extra when a
valid field wasn't set. This will happen until translators (most notably
Embedded Metadata) are fixed to stop setting redundant fields.

https://forums.zotero.org/discussion/81262/translator-error-sage-lots-of-extra-data-in-extra
2020-02-17 00:22:34 -05:00
Dan Stillman
b41734924d Further fixing of "Too many sync requests" error
Follow-up to 804a898c98

Addresses #1788
2020-02-16 18:05:45 -05:00
Tom Najdek
8f1acad2d8 Allow session history in a hidden browser
Allows loaded pages to use window.history object without triggering
NS_ERROR_FAILURE
2020-02-16 13:33:09 -05:00
Dan Stillman
804a898c98 Hopefully fix "Too many sync requests" after file upload 412
Addresses #1788
2020-02-16 13:06:49 -05:00
Dan Stillman
5c95d4e0ba Additional logging for "Item collection not found" error in toJSON() 2020-02-16 12:43:46 -05:00
Dan Stillman
a53f363b8d Additional fix for search crash with includeParentsAndChildren
Follow-up to 76081ab05
2020-02-11 13:09:54 -05:00
Adomas Venčkauskas
1db3fc0b49 Fix a benign citation dialog error when pressing ESC to quit 2020-02-11 15:24:41 +02:00
Adomas Venčkauskas
43a38d31a7 Fix locator strings (p123) not working when editing a citation with items present 2020-02-11 15:24:41 +02:00
Dan Stillman
76081ab05f Fix crash when search uses no-op condition and includeParentsAndChildren
E.g., a nonexistent saved search
2020-02-11 00:23:45 -05:00
Dan Stillman
61684d8899 Fix missing bottom border of toolbar on Windows 2020-02-10 22:24:27 -05:00
Dan Stillman
2a804d5d4a Fix zotero://open-pdf links on Windows if no handler is set in registry 2020-02-09 14:07:11 -05:00
Dan Stillman
4290f26d7c Don't search child items in "Title, Creator, Year" mode
They can't match, so there's no need to include them. This should speed
up "Title, Creator, Year" searches.
2020-02-05 09:27:06 -05:00
Adomas Venčkauskas
8fd83795e8 Remove MacWord plugin IPC pipe initialization
Moved to MacWord plugin codebase:
zotero/zotero-word-for-mac-integration#6adf8a7
2020-02-05 16:23:14 +02:00
Dan Stillman
86a5c46b1e Find Available PDF: Don't mark URLs that redirect as tried
https://forums.zotero.org/discussion/81182
2020-02-02 23:47:40 -05:00
Dan Stillman
eec0f00784 Fix sorting by editor in Creator column (since 5.0.78) 2020-01-29 13:39:59 -05:00
Dan Stillman
851af7f45b Don't save library catalog from translation if not valid for item type
Fixes #1781
2020-01-28 20:20:07 -05:00
Dan Stillman
4e11c7927d Don't skip creator lines in Extra in fromJSON
Regression in 3de54455f6
2020-01-27 22:01:25 -05:00
Adomas Venčkauskas
39d7f22981 Fix some drag and drop issue in the citation dialog
See https://forums.zotero.org/discussion/81063/beta-rearranging-citations-in-quick-citation-window
2020-01-27 11:54:22 +02:00
Dan Stillman
8cac7f63f4 Update locales from Transifex, including new connector files 2020-01-26 03:29:23 -05:00
Dan Stillman
48741100a5 Don't try to pull retractions list from server at startup during tests
This causes problems with filtered test runs, since the request is
cancelled and the long response gets dumped to the console, making the
test result hard to find.
2020-01-26 03:29:23 -05:00
Dan Stillman
3de54455f6 Automatically save unknown/invalid fields to Extra in non-strict mode
This is a prerequisite for starting to use new fields in translators,
since otherwise switching from, say, storing originalDate in Extra to
using an originalDate field would cause the value to be lost in clients
without the newer schema.

Closes #1504
2020-01-26 03:29:23 -05:00
Dan Stillman
55c88dc91c Fix broken string in nb-NO locale that causes a crash in My Publications 2020-01-22 12:12:55 -05:00
Dan Stillman
98e637d36a Update locales from Transifex 2020-01-21 19:23:41 -05:00
Dan Stillman
9ff88bdf6c Enable Norwegian Bokmål 2020-01-18 11:46:05 -05:00
Dan Stillman
c342618e63 Update locales from Transifex 2020-01-17 18:08:01 -05:00
Adomas Venčkauskas
23550f2951 More citation dialog locator fixes
Both typing 123 and typing p.123 adds the locator to the most
recently added node
2020-01-16 11:51:40 +02:00