Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select items links added to report are not recognizing group items again #77

Open
acsr opened this issue Dec 31, 2022 · 1 comment
Open

Comments

@acsr
Copy link

acsr commented Dec 31, 2022

Select item links are still useful

Beneath zotero-report-customizer is currently not working for the main purpose (omitting field content in the output by deselection in the UI) there is(was) still the useful feature to include to include select item links in the report.

Was working after fixing #42

e2ce253 fixed the incorrect group links for some time, but the if clause seems not to be working to recognize user groups anymore.

Links for group items broken

Generated links are now again always pointing to the main library while the item ID is correct for the group item.

Other settings checked

If you activate the hidden setting for weblinks extensions.zotero.report-customizer.link.web as true in the zotero config. The whole report is broken and empty.

Setting extensions.zotero.report-customizer.bibliography to true has no effect for me

If clauses may not work anymore

the code at https://github.com/retorquere/zotero-report-customizer/blob/master/content/report.pug#L39

mixin selectLink(item)
  - var link
  if Zotero.Prefs.get('report-customizer.link.web')
    - link = item.uri.replace(/^http:/, 'https:')
  else if ! item.libraryID || item.libraryID === Zotero.Libraries.userLibraryID
    - link = `zotero://select/library/items/${item.key}`
  else
    - link = `zotero://select/groups/${item.libraryID}/items/${item.key}`
  a(href=link) #{link}
  1. first checks just if the weblink config is set to true and then defaults to a weblink without further checking of group or main library (which is wrong, and leaves out the following clauses for group vs. main library.)
  2. the check if the item belongs to a group library seems too simple and is not working anymore.

Suggestion

please check the code in the official eta-template example for BetterBibTex I use in the Export Quick-Copy settings:
(from this suggestion of the author: https://forums.zotero.org/discussion/comment/384569/#Comment_384569)

<% it.items.forEach(function(item) { 
  const [ , kind, lib, key ] = item.uri.match(/^https?:\/\/zotero\.org\/(users|groups)\/((?:local\/)?[^/]+)\/items\/(.+)/)
  const select = (kind === 'users') ? `zotero://select/library/items/${key}` : `zotero://select/groups/${lib}/items/${key}`
%>[@<%= item.citationKey %>](<%= select %>)<% }) %>

This code works for me to generate proper differentiation of the select links when using Quick-Copy with BetterBibTex.

hope this helps to fix this again.

Fixing the weblink flag to differentiate group and main library could be another ticket.

@acsr
Copy link
Author

acsr commented Dec 31, 2022

related ticket #78 created with linking also to former reference ticket #67

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant