Available for beta testing: Google Docs integration

  • @adomasven Thanks for your attention. It should be a temporal error. At this moment it works perfectly, seems that it only needs to restart.

    Thanks again.
  • Great work! However there is a show stopper for me. I need a way to make citation hyperlinks to point to the original web http source where I have that. I do not want it to link to the zotero.org sites repository stored objects. Citations work as I want in OpenOffice, but not in google docs. Is there something I have missed, thanks!
  • Do you have an example? The citations should like the same they do in LibreOffice (note that OpenOffice is no longer supported, so no guarantees that'll stop working; where it does work, it's the same as Libre, though).
  • Thanks for your reply. You are right, I used LibreOffice and not OpenOffice, just old habit calling it OpenOffice, sorry. I am not sure what you expect as an example. I did a simple test now, added a random web page article to my Zotero library. Both "View Online" and "View Snapshot" works as expected in Zotero itself. When citing this in Google Docs I get a footnote text like this:
    “Sustainable, High Energy Density Battery Created,” ScienceDaily, accessed June 2, 2018, https://www.sciencedaily.com/releases/2017/03/170303091411.htm.
    The entire bookmark text is a google docs hyperlink, if I look at the link address in the link dialog, it has: https://www.zotero.org/google-docs/?YB8jZ7 and not the www.sciencedaily.com "online" URL. I expected the URL to be identical with the URL in the bookmark text. Funny thing is, now it is broken in LibreOffice, but it is a different problem with the link URL. It is based on the https://www.sciencedaily.com/... URL and is almost right. But something weird is going on as letters are missing in the URL protocol part after export to PDF. I have seen both htps://.. and http:// variants instead of the expected https://..., needless to say, navigating from the bookmark hyperlinks in the PDF does not work, but for different reasons. I don't have a clue what is going on here, it is not encoded as a hyperlink in the document. I see the correct URL with https://... in the reference section in LibreOffice Navigator. This may be totally unrelated and may be an LibreOffice problem, not Zotero, but it may be a clue to something relating the two issues. Thanks.
  • The footnote part was the key here for the example. I'm not sure there's going to be an easy solution for that given how Zotero enables the linking between google doc and and zotero database (which is using the Zotero link).
    However, (and please test this in a unimportant/test document) if you remove citation links, the links to Zotero should go away, so you could do that before submitting). Does that work?
  • This is fantastic. In terms of possible errors, my sense is that the errors are likely to occur with the citation use in the document, but won't mess up my zotero/Jurism database and entries. Is that right?
  • @adamsmith that actually works, thanks for the tip. That may actually be what I need, for now, to start collaborating on a set of documents in a group as I had planned. I tested using the unlink function and after saving as PDF from google docs the hyperlinks work as expected. So, this is a possible work-flow until a propper solution is found. Clearly one need to be careful now to make a copy before you do unlink. In case you forget, then all bets may be off. Round trip to and from various formats are not completed as I see in docs, and I am not sure how easy the google docs history can rescue your day.

    I guess conceptually the way the URLs are set up could be an option in preferences of the connector. Right now the links to https://www.zotero.org/google-docs/?YB8jZ7 does not work at all, are they intended to work? You may have said something to the effect it is utterly broken, but I am not sure I got the gist of that. If you think it is possible to fix, I may put some effort into making a pull request. However, Google app scripts is all new to me and I am not much of a javascript coder either. But I am not adversed to learning a new stuff. Have to spend some time studying the code first, and possibly ask some questions. E.g.: Could it be possible to hook into the save/saveAs methods and inject zotero connector code there handling the zorento generated hyperlink formating and roundtrip issues between formats?
  • @ejzejz I am not sure what you refer to exactly as fantastic. I guess you just generally noted that there where a lot of broken stuff. But for the record, nothing bad happen to my zotero archive. Just hyperlinks in documents are broken as far as I can tell. Only after export to PDF in the LibreOffice case. The errors I noted in LibreOffice concerns me little right now, as I do not intend to use LibreOffice as long as no round trip conversion LibreOffice, Word, GoogleDocs does not work such that relations between citations and zotero is retained. I will spend some time getting to know zotero connector code, I guess in general, and then I will see if I can set aside some time contribute with moving forward with features I would like. It does not seem overly complicated from the outside, but I am sure there are obstacles in the technologies here, so it may be hard as I think @adamsmith indicated.
  • @ejzejz there is no potential for your library corruption, only the actual google doc.

    @bjornr It is not possible to do away with the hyperlinks - this is how Zotero recognises and differentiates citations in documents and there is no way to work around that due to Google Docs limitations.
  • @adomasven OK, thanks for your response! I guess the issue then is how to remove broken hyperlinks from output when I save from Google Docs in other formats, such as PDF. I guess this could be done as post processing on PDFs. Alternatively, as I tested, make a temporary copy in google docs, unlink in the copy, then save PDF from the copy, and finally remove the the copy. I guess for some users, links to zotero.org would be fine as well if they actualy worked. They could pull out an archived copy, or redirect to the actual site. I sort of expected that was what was intended, but the links are not resolving. The group holding the archive is not public, so that may be the reason. However, in my case, for the project I am working on, I prefer to have hyperlinks removed from PDFs over having indirections or links to archived files on zotero.org.
  • edited June 7, 2018
    Report ID: 1418690961

    Zotero experienced an error while communicating with Google Docs:

    An error occurred while updating fields. ["mwj52W"]


    This occurred when trying to insert a single reference into a Doc using Firefox 60.0.1 on Ubuntu 16.04.4.

    The "Updating" link stayed in the Doc, and when clicked gave "Selected field mwj52W not returned from Docs backend"

    Likely occurred because I was in "Suggest" mode, rather than "Edit" mode, because when I changed back to edit Edit mode the reference was added.
  • edited June 7, 2018
    After being away from the document for a while, with everything working previously, I am receiving the error:
    Zotero experienced an error updating your document.

    401: Google Docs Authorization failed. Try again.
    "error": {
    "code": 401,
    "message": "Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
    "status": "UNAUTHENTICATED"
    But I was not offered to report the error.

    Neither restarting Zotero nor reloading the Doc seemed to help. However, both seem to be working independently.

    After waiting some more time, all seems to be working again.
  • 429: Google Docs Authorization failed. Try again.
    "error": {
    "code": 429,
    "message": "Resource has been exhausted (e.g. check quota).",
    "status": "RESOURCE_EXHAUSTED"
    I really need it because I MUST add my thesis bibliography this week!!! Help!!
  • @cmee how many citations do you have in this document? What action triggers this error?
  • @adomasven 110 I think, refresh action. And add bibliography. I deactivate the option "automatically refresh" and then the error appears.
  • @cmee you should make sure you are running the beta version of the connector and try the document update with it after updating it to the latest version.
  • edited July 14, 2018
    A quick bug report:

    Trying to insert references with html subscripts in the title (e.g. "CO< sub>2< /sub>", without spaces, apparently html tags get hidden when posting here) into Google Docs doesn't work, giving the following errors:

    Zotero experienced an error updating your document.

    Exception: We're sorry, a server error occurred. Please wait a bit and try again.
    at Code (Zotero Google Docs Integration):892
    at Code (Zotero Google Docs Integration):797
    at Code (Zotero Google Docs Integration):857
    at Code (Zotero Google Docs Integration):857
    at Code (Zotero Google Docs Integration):857
    at Code (Zotero Google Docs Integration):781
    at Code (Zotero Google Docs Integration):498
    at Code (Zotero Google Docs Integration):358
    at Code (Zotero Google Docs Integration):344
    at Code (Zotero Google Docs Integration):60 (callMethod)

    Removing the offending html fixes this.

    Superscripts don't cause the same problem (e.g. 7< sup>th< /sup>), but I am not sure what happens with other formating

    PS I tried a quick search and haven't seen this bug reported before, sorry if it is a duplicate
  • @gabbro Should be fixed now. Thanks for the report!
  • As at my workplace Zotero itself is only allowed as it is open source and not affiliated with one of the usual data collectors the same goes for office software. Therefore usage of any google or similar product is not allowed. google docs beeing one of those.

    So my question: as there are open source alternatives (actually zotero beeing open itself should prefer these over google - but thats another thing): are there any plans for integrating a open source collaborative online office solutions like onlyoffice or colabora?
  • Given the resources needed, that's very unlikely unless any of those projects either becomes sufficiently large or happens to implement the same API/scripting code as google docs (which is unlikely I think). You can use existing scan-based solutions like https://zotero-odf-scan.github.io/zotero-odf-scan/
  • edited August 3, 2018
    This is very cool. Haven't tried it yet, but something I'd like to use in the future for collaboration.

    The first post briefly describes sharing, and some responses talk about conflicting edits. But how exactly are libraries integrated into the document?

    Can all editors add entries from their own libraries?
    Can I add a citation to a reference from my collaborator's library without access to their library directly? (I assume that entry would need to have already been cited somewhere in the document. But if so, can I?)
    Do shared references in different libraries end up doubled?
    Does "refresh"/sync work if I change something in my library? What if this differs from my collaborator's?

    (I've wondered similar things about simply sharing-- via email-- Word documents and taking turns editing. So in that case up to now I've avoided actually editing any citations within the document if it's my collaborator's file, in order to not corrupt or confuse anything. So I'm not sure how that would work either, or if Google Docs integration is designed differently to handle it.)
  • Can all editors add entries from their own libraries?
    Can I add a citation to a reference from my collaborator's library without access to their library directly?
    This is the same as sharing documents with your colleagues. The citation dialog will list already cited items (even if not present in your library) at the top of the result list.
    Do shared references in different libraries end up doubled?
    If you each cite the same reference from your individual libraries, then yes.
    Does "refresh"/sync work if I change something in my library? What if this differs from my collaborator's?
    It does. If your collaborator has cited the item from the "cited" subsection, they cited "your" item, so if you change the item metadata and refresh, that citation will be updated too.

    Generally you may still want to use group libraries, to avoid duplicate items by mistake, but you don't technically need them to collaborate productively.
  • OK, thank you!! That is very clear, and it helps me understand what (not) to do when editing documents with someone. Glad it's that simple!

    The only concern then would be potentially doubling entries if something is already cited by the collaborator, and also figuring out "whose" entry is in use in a document if we want to update it in our respective libraries to fix something.

    I did not realize the already-cited list was anything other than a shortcut (e.g., auto-complete) to entries in the library. That's very helpful in general. Sounds like the relatively ideal solution for a complex situation.
  • Since this morning, using Google Docs integration, I'm experiencing the error
    "Zotero experienced an error updating your document. linkbubble is null". It happens immediately when I start Zotero, then create a new google docs document, and insert an new citation.
    Oddly, I can add citations to an existing document, but there I get an error when I do a refresh: "Zotero experienced an error updating your document. json.citationItems is undefined"
  • @ppraet did you install any new extensions since last using Google Docs integration? Does it start working if you disable other extensions and restart the browser? Does Google Docs interface look different than before?
  • @adomasven No, nothing that I'm aware off. It worked last night, and I continued this morning, noticing the problem at the first 'refresh' of a rather long document I'm working on. I restarted the PC and created a completely empty new Google docs, to troubleshoot.
    Looking at the extensions, I see nothing unusual. Just Markdown here, which has been there for ages.
  • @ppraet Could you produce a Debug ID from the Zotero Connector?

    1. Open the Zotero Connector preferences
    2. In the Advanced tab of the Zotero Connector preferences, check the box next to “Enable Logging.” Do not close this tab.
    3. In a new tab navigate to a new Docs document and attempt to insert a citation.
    4. Go back to the Advanced tab of the Zotero Connector preferences, uncheck "Enable Logging" and click Submit to Zotero Server.
    5. You will be provided with a Debug ID (e.g., “D12345678”). Please post the Debug ID in this thread.
  • Can I just check whether this is still Firefox only? Are there some Instructions or a screen cast somewhere? (Away from desktop at the moment, but will test this when back.)
  • @adomasven The Debug ID is D681494429.

    OTOH, I believe I might have had a Zotero update this morning? I have automated updates on, so I didn't notice, but looking at the version history...
  • edited August 17, 2018
    @ppraet Sorry, the most recent changes to the Connector Beta have introduced a couple of bugs. You can temporarily switch to the Zotero Connector 5.0.40 or wait and we'll have a fix out in a few hours.

    @bjohas Yes, it's still Firefox only
This discussion has been closed.