Plugin change required: Items list sort column validation in 6.0.10-beta.3

39 views
Skip to first unread message

Dan Stillman

unread,
Jul 9, 2022, 2:47:17 AM7/9/22
to zotero-dev
We recently received a report [1] from a user of a broken items list at
startup, which we believe was caused by 1) a plugin adding a field
('day') to the Zotero database, 2) that invalid field being set as a
secondary-sort field in the items list, 3) a Zotero beta update wiping
out the field change during a routine schema update, and 4) the
then-unknown field triggering an error during items list sorting, even
after all plugins had been disabled.

Plugins should certainly not try to add fields to the database — really,
plugins shouldn't be writing to Zotero's database at all — so if anyone
knows what plugin is doing this, please let me know so that I can reach
out to the developer. (Or if you're the developer and are reading this,
please get in touch so we can recommend a better approach.)

Nevertheless, invalid fields in the sort settings shouldn't cause a
hang, so we've added field validation to the items list in the latest
beta. This will fix the hang for any users of this plugin in 6.0.10, but
it will likely also break sorting by any custom columns added to the
items list by plugins. If your plugin does this, you'll likely want to
monkey-patch the new `ItemTree::_isValidSortField()` function [2] (if
present) to allow your custom column. We could probably add a cleaner
way to register such a field if there's interest.

- Dan

[1]
https://forums.zotero.org/discussion/98266/109136998-error-invalid-field-day
[2]
https://github.com/zotero/zotero/blob/fe74b02d28de448b9fd4f9d106632ebf6954d441/chrome/content/zotero/itemTree.jsx#L1876-L1880

Dan Stillman

unread,
Jul 11, 2022, 12:39:17 AM7/11/22
to zoter...@googlegroups.com
After thinking about this more, we're going to try to prevent breakage
from rogue plugins here in a way that doesn't inconvenience everyone else.

So sorting on custom fields will be broken in the current beta
(6.0.10-beta.6), but we'll push out a new beta shortly that restores
syncing on custom columns.

Sorry for the false alarm.

- Dan
Reply all
Reply to author
Forward
0 new messages