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

Citations pane fails to render when language set to standard English #247

Closed
chenboshuo opened this issue Mar 26, 2023 · 19 comments
Closed
Labels
bug Something isn't working

Comments

@chenboshuo
Copy link

chenboshuo commented Mar 26, 2023

  1. I added citations to some articles, however, these items appeared in the "Related" field, not the "Citations" field.
  2. Showing the local citation network is not working.
    image
    image

the software versions can find in #241 (comment)_

@Dominic-DallOsto
Copy link
Collaborator

Dominic-DallOsto commented Mar 26, 2023 via email

@chenboshuo
Copy link
Author

  1. This is working for me again now. Are you on the latest version (0.5.5)?

Yes
image

  1. This only works when you have 2 or more items selected (Ctrl + click
    to select multiple items). Does it work for you then?

Yes, it works , however I also don't know how to show links of items in different collections.

Thanks you for your attention.

@Dominic-DallOsto
Copy link
Collaborator

Dominic-DallOsto commented Mar 27, 2023 via email

@chenboshuo
Copy link
Author

Hmm. in 1 it looks like the whole citations tab is failing to render
properly. Do you see the citations note saved under the item when you
add the citations?

the citations were saved in Related tab, and show properly in the network

For 2. I guess use the "my library" view to show all your items then
select the ones you want. Or use a search to return just the items
you're interested in, then select those. At least for me on Windows it
isn't possible to Ctrl + click to highlight multiple collections at
once, so we can only really show one selected collection at a time in
the local citation graph.

Yes, I get it

@diegodlh
Copy link
Owner

Hi, @chenboshuo! I've tried Cita v0.5.5 on Zotero 6.0.26 on Linux Mint 19.2 and I'm not being able to reproduce your problem.

I wonder whether it's because of an interaction with another addon? Could you try disabling all but Cita and see what happens?

If that doesn't solve the issue, maybe you can share a debug output log with us:

  1. Enable logging: in Zotero, go to Help > Debug Output Logging > Enable.
  2. Follow the steps to reproduce the behavior described above.
  3. Go to Help > Debug Output Logging > View Output.
  4. On the window that opens, go to File > Save to save the log. Attach this file to this bug report.
  5. Close the Debug Output window and disable logging: Help > Debug Output Logging > Disable.

@marbris
Copy link

marbris commented Apr 25, 2023

@diegodlh, I'm having the same problem as @chenboshuo. I disabled all other add-ons. My log outputs the following every time I press the Citations tab:

(3)(+0005105): Viewing item in pane 6

(3)(+0000000): {Cita} Tue Apr 25 2023 16:35:51 GMT-0700 (PDT): Refreshing citations pane... (zotero-editpane-tabs)

(3)(+0000001): {Cita} Tue Apr 25 2023 16:35:51 GMT-0700 (PDT): CitationsBoxContainer will render...

(3)(+0000025): {Cita} Tue Apr 25 2023 16:35:51 GMT-0700 (PDT): Getting citations from source item took 24.461381999979494

I'm using Cita 0.5.5, Zotero 6.0.26, and Ubuntu 22.04

Just like for chenboshuo, the citations end up in the Related tab. However, adding items to the Related tab does not add them to the Citations Note.

I appreciate the help.

@diegodlh
Copy link
Owner

Hi, @marbris. Thanks for your feedback. So I assume both you and @chenboshuo see the "Add" button in the "Citations" pane before adding any citations to an item? Or how do you add citations?

If yes, then the citations pane content disappears after a citation is added, correct?

Could you share the content of one of the "Citations" attachment notes? You should find it as an attachment in one of the items you are having trouble with.

Thanks!

@marbris
Copy link

marbris commented Apr 26, 2023

@diegodlh . There is no "Add" button in the Citations pane. I have to add citations by going to the cited item and clicking "add as citation(s) to...". When I do, an item is added to the Related Pane and a Citations Note is created. The Related pane does have an "add" button, but it doesn't add things to the Citations Note.

Citations_Pane

Related_Pane

Here's the Citation Note:

Citations

Do not edit this note manually!

[
  {
    "item": {
      "itemType": "journalArticle",
      "creators": [
        {
          "firstName": "Kevin G.",
          "lastName": "Gallagher",
          "creatorType": "author"
        },
        {
          "firstName": "Stephen E.",
          "lastName": "Trask",
          "creatorType": "author"
        },
        {
          "firstName": "Christoph",
          "lastName": "Bauer",
          "creatorType": "author"
        },
        {
          "firstName": "Thomas",
          "lastName": "Woehrle",
          "creatorType": "author"
        },
        {
          "firstName": "Simon F.",
          "lastName": "Lux",
          "creatorType": "author"
        },
        {
          "firstName": "Matthias",
          "lastName": "Tschech",
          "creatorType": "author"
        },
        {
          "firstName": "Peter",
          "lastName": "Lamp",
          "creatorType": "author"
        },
        {
          "firstName": "Bryant J.",
          "lastName": "Polzin",
          "creatorType": "author"
        },
        {
          "firstName": "Seungbum",
          "lastName": "Ha",
          "creatorType": "author"
        },
        {
          "firstName": "Brandon",
          "lastName": "Long",
          "creatorType": "author"
        },
        {
          "firstName": "Qingliu",
          "lastName": "Wu",
          "creatorType": "author"
        },
        {
          "firstName": "Wenquan",
          "lastName": "Lu",
          "creatorType": "author"
        },
        {
          "firstName": "Dennis W.",
          "lastName": "Dees",
          "creatorType": "author"
        },
        {
          "firstName": "Andrew N.",
          "lastName": "Jansen",
          "creatorType": "author"
        }
      ],
      "title": "Optimizing Areal Capacities through Understanding the Limitations of Lithium-Ion Electrodes",
      "abstractNote": "Increasing the areal capacity or electrode thickness in lithium ion batteries is one possible means to increase pack level energy density while simultaneously lowering cost. The physics that limit use of high areal capacity as a function of battery power to energy ratio are poorly understood and thus most currently produced automotive lithium ion cells utilize modest loadings to ensure long life over the vehicle battery operation. Here we show electrolyte transport limits the utilization of the positive electrode at critical C-rates during discharge; whereas, a combination of electrolyte transport and polarization lead to lithium plating in the graphite electrode during charge. Experimental measurements are compared with theoretical predictions based on concentrated solution and porous electrode theories. An analytical expression is derived to provide design criteria for long lived operation based on the physical properties of the electrode and electrolyte. Finally, a guideline is proposed that graphite cells should avoid charge current densities near or above 4 mA/cm2 unless additional precautions have been made to avoid deleterious side reaction.",
      "date": "2016-11-10",
      "url": "https://iopscience.iop.org/article/10.1149/2.0321602jes",
      "accessDate": "2021-10-04",
      "extra": "Publisher: The Electrochemical Society\nQID: Q57457262",
      "volume": "163",
      "pages": "A138-A149",
      "publicationTitle": "Journal of The Electrochemical Society",
      "DOI": "10.1149/2.0321602jes",
      "issue": "2",
      "ISSN": "0013-4651"
    },
    "ocis": [
      "010117846185-01057457262"
    ],
    "zotero": "533VATI4"
  }
]

@Dominic-DallOsto
Copy link
Collaborator

Dominic-DallOsto commented Apr 26, 2023 via email

@marbris
Copy link

marbris commented Apr 26, 2023

@Dominic-DallOsto The tabs look the same for all items, including ones without Citations.

@Dominic-DallOsto
Copy link
Collaborator

I just checked the debugging log for my own instance of Cita and got this:

Just to check you never get the Rendering CitationsBoxContainer took line in your debug logs?

(3)(+0086376): itemTree.render(). Displaying Item Tree

(3)(+0000038): Viewing item in pane 6

(3)(+0000039): {Cita} Wed Apr 26 2023 17:55:59 GMT+0200 (W. Europe Summer Time): Refreshing citations pane... (item-tree-main-default)

(3)(+0000002): {Cita} Wed Apr 26 2023 17:55:59 GMT+0200 (W. Europe Summer Time): CitationsBoxContainer will render...

(3)(+0000015): {Cita} Wed Apr 26 2023 17:55:59 GMT+0200 (W. Europe Summer Time): Getting citations from source item took 14.787300005555153

(1)(+0000009): Localized string not available for More...

(3)(+0000021): {Cita} Wed Apr 26 2023 17:55:59 GMT+0200 (W. Europe Summer Time): Rendering CitationsBoxContainer took 45.868599995970726ms.

(4)(+0000103): Unregistering notifier observer in notifier with id 'citationsBox_Wr'

(3)(+0000003): {Cita} Wed Apr 26 2023 17:55:59 GMT+0200 (W. Europe Summer Time): First run, or props.item has changed

@marbris
Copy link

marbris commented Apr 26, 2023

@Dominic-DallOsto . yes. The log ends after "Getting citations from source item took XX.X"

@marbris
Copy link

marbris commented Apr 26, 2023

@Dominic-DallOsto @diegodlh . I just found the Error Console. Here's the error I get when pressing the Citations tab:

[JavaScript Error: "Error: Localized string not available for More..." {file: "chrome://zotero/content/xpcom/intl.js" line: 137}] Zotero.Intl</this.getString@chrome://zotero/content/xpcom/intl.js:137:15 this.getString@chrome://zotero/content/xpcom/zotero.js:1323:34 get text@chrome://zotero/content/components/button.js:134:340 render@chrome://zotero/content/components/button.js:137:5 finishClassComponent@chrome://cita/content/main.js:29775:22 updateClassComponent@chrome://cita/content/main.js:29725:24 beginWork@chrome://cita/content/main.js:31363:16 callCallback@chrome://cita/content/main.js:16235:9 invokeGuardedCallbackDev@chrome://cita/content/main.js:16284:7 invokeGuardedCallback@chrome://cita/content/main.js:16346:3 beginWork$1@chrome://cita/content/main.js:36249:7 performUnitOfWork@chrome://cita/content/main.js:35064:12 workLoopSync@chrome://cita/content/main.js:34992:5 renderRootSync@chrome://cita/content/main.js:34955:7 performSyncWorkOnRoot@chrome://cita/content/main.js:34578:18 ./node_modules/react-dom/cjs/react-dom.development.js/flushSyncCallbackQueueImpl/<@chrome://cita/content/main.js:23617:26 unstable_runWithPriority@chrome://cita/content/main.js:41996:12 runWithPriority$1@chrome://cita/content/main.js:23566:10 flushSyncCallbackQueueImpl@chrome://cita/content/main.js:23612:9 flushSyncCallbackQueue@chrome://cita/content/main.js:23599:3 scheduleUpdateOnFiber@chrome://cita/content/main.js:34178:9 updateContainer@chrome://cita/content/main.js:37767:3 legacyRenderSubtreeIntoContainer@chrome://cita/content/main.js:38322:5 render@chrome://cita/content/main.js:38388:10 refreshCitationsPane@chrome://cita/content/main.js:6761:9 refreshCitationsPane@chrome://cita/content/main.js:6121:3 set_selectedIndex@chrome://global/content/bindings/tabbox.xml:395:15 set_selectedItem@chrome://global/content/bindings/tabbox.xml:420:34 _selectNewTab@chrome://global/content/bindings/tabbox.xml:465:11 onxblmousedown@chrome://global/content/bindings/tabbox.xml:774:11

@Dominic-DallOsto
Copy link
Collaborator

Dominic-DallOsto commented Apr 26, 2023

I think the issue comes from this change here - https://github.com/diegodlh/zotero-cita/pull/242/files#diff-696fbdb6810c9001e0b8a27f808632396389131c08925b7d50cf8fbae528245d

Now we resolve the localised string (to More...), then Zotero tries to localise it again and fails. For me this doesn't cause an error though - it appears in the Debug output but not in the error console with Zotero 6.0.26 on Windows.

If I revert the change, Zotero tries to localise the string instead of Cita, which also doesn't work.

@Dominic-DallOsto
Copy link
Collaborator

I guess these might be options to fix this:

  • replace the Button component with one that doesn't try to do localisation
  • try/catch the button text localisation somehow
  • connect Cita's localisation to Zotero's so it can successfully localise the string

But first it would be interesting to find why this causes an error on Ubuntu and Mac but not Windows or Linux Mint...

@diegodlh
Copy link
Owner

But first it would be interesting to find why this causes an error on Ubuntu and Mac but not Windows or Linux Mint...

I think it may be unrelated to operative system but to Zotero language instead. I managed to reproduce the issue changing the Zotero language to standard English. It was not showing with Zotero set to Spanish. I assume you may not be using English as well, @Dominic-DallOsto?

Assuming @chenboshuo and @marbris are using Zotero in standard English, could you check if changing the language to another version of English (such as English UK) solves the problem, as a workaround until this bug is fixed?

Thanks!

@drewx0r
Copy link

drewx0r commented May 13, 2023

@diegodlh I changed my Zotero language from English to English (Canada) and the plug-in started behaving as expected!

@diegodlh diegodlh changed the title add citations failed Citations pane fails to render when language set to standard English May 14, 2023
@marbris
Copy link

marbris commented May 15, 2023

The plug-in works as expected when I change the language from English to English (Canada)

@diegodlh diegodlh added the bug Something isn't working label May 16, 2023
@Dominic-DallOsto
Copy link
Collaborator

Fixed in v1.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants