justinribeiro / zotero-google-scholar-citation-count

Zotero plugin for fetching number of citations from Google Scholar.
Mozilla Public License 2.0
178 stars 0 forks source link

Plugin breaking Zotero items list #30

Closed dstillman closed 10 hours ago

dstillman commented 16 hours ago

Reported here: https://forums.zotero.org/discussion/119272/failed-restoring-zotero-data

[JavaScript Error: "TypeError: fieldExtra.match(...) is null" {file: "jar:file:///Users/[…]/Library/Application%20Support/Zotero/Profiles/[…].default/extensions/justin@justinribeiro.com.xpi!/chrome/content/gscc.js" line: 405}]
dataProvider@jar:file:///Users/[…]/Library/Application%20Support/Zotero/Profiles/[…].default/extensions/justin@justinribeiro.com.xpi!/chrome/content/gscc.js:405:18
getCustomCellData@chrome://zotero/content/xpcom/itemTreeManager.js:218:22
ItemTreeRow.prototype.getField@chrome://zotero/content/itemTree.js:3836:33
_getRowData@chrome://zotero/content/itemTree.js:3164:23
_renderItem@chrome://zotero/content/itemTree.js:2967:26
_renderItem@chrome://zotero/content/components/virtualized-table.js:1148:27
render@chrome://zotero/content/components/windowed-list.js:140:28
invalidate@chrome://zotero/content/components/windowed-list.js:118:10
_getItemCount@chrome://zotero/content/components/windowed-list.js:277:12
_getRangeToRender@chrome://zotero/content/components/windowed-list.js:244:28
render@chrome://zotero/content/components/windowed-list.js:136:42
invalidate@chrome://zotero/content/components/windowed-list.js:118:10
invalidate@chrome://zotero/content/components/virtualized-table.js:1310:20
set selectEventsSuppressed@chrome://zotero/content/components/virtualized-table.js:276:20
changeCollectionTreeRow/<@chrome://zotero/content/itemTree.js:1094:7
Hh@resource://zotero/react-dom.js:103:175
Ji@resource://zotero/react-dom.js:180:186
Hi@resource://zotero/react-dom.js:179:278
Hk@resource://zotero/react-dom.js:178:331
Rk@resource://zotero/react-dom.js:197:314
xb@resource://zotero/react-dom.js:196:166
Ni@resource://zotero/react-dom.js:187:248
S@resource://zotero/react.js:17:26
U@resource://zotero/react.js:21:229
justinribeiro commented 10 hours ago

That's....a very strange error. The cause is correct (it's a null hit), but it's also because someone broke the format in the extra field (such that it passes check 1 and fails the subsequent lookup). Looks like this person manually changed what the plugin sets in Extra, subsequently breaking it.

It's an edge case for sure, but a good one. Patch incoming.

justinribeiro commented 9 hours ago

v4.0.1 now resolves this edge case. https://github.com/justinribeiro/zotero-google-scholar-citation-count/releases/tag/v4.0.1