Bug report: error transcribing "/", "&" etc.

Whenever I save an item with "/" in the title, the title in Zotero will instead display "/" and "&" as "&". Is there a fix for this?
  • dstillman Zotero Team
    We always need an example URL for problems with saving.
  • Thanks, this was just an issue with the clinicaltrials.gov translator. Fixed. Your Zotero Connector should auto-update within a few minutes, or you can update translators manually from the Advanced pane of the Zotero settings.
  • Amazing. Is there a way to Find & Replace (ctrl F) for such terms within a library to replace all the errors with the correct text?
  • Select all the items in the library (Ctrl-A), then open Tools → Developer → Run JavaScript..., paste this in, and press Run:

    return Zotero.DB.executeTransaction(async () => {
    let count = 0;
    for (let item of ZoteroPane.getSelectedItems()) {
    if (item.getField('libraryCatalog') !== 'clinicaltrials.gov') {
    continue;
    }
    for (let field of ['title', 'shortTitle', 'abstractNote']) {
    item.setField(field, Zotero.Utilities.unescapeHTML(item.getField(field)));
    }
    for (let [i, creator] of item.getCreators().entries()) {
    if (creator.firstName) creator.firstName = Zotero.Utilities.unescapeHTML(creator.firstName);
    if (creator.lastName) creator.lastName = Zotero.Utilities.unescapeHTML(creator.lastName);
    item.setCreator(i, creator);
    }
    await item.save();
    count++;
    }
    return `Updated ${count} items`;
    });


    That code will fix the titles, short titles, abstracts, and authors. It only touches items that came from clinicaltrials.gov, so it's safe to run it on the whole library.

    Let me know if that does the trick.
Sign In or Register to comment.