cannot sync because creator name is too long

When i try to sync i keep getting the following message: The creator name _____ is too long, shorten the field and sync again.

It seems that all the articles with creator fields that are too long are coming from psycinfo which I accessed through OVID. I downloaded the file from OVID as ris. How can I fix this? I have approximately 531 articles from psycinfo, should click correct for every article.
  • edited December 9, 2022
    This generally means that the RIS file being produced by the site specified authors incorrectly, resulting in a huge long string of names. When you use the save button, Zotero usually corrects this kind of thing, but that doesn't happen if you export to a file first. If you can provide an example search that produces this file, we can see if we can do something to correct it going forward, or we may be able to tell you a find/replace you could run to fix the names in the file in order to reimport them. (You can delete the whole batch of items you already imported by sorting the items list by Date Added.)
  • I am having this issue with a library of about 10,000 citations that I would like to share. Is there a way to delete the 'editor' field on a batch level i.e. delete all editor fields from all refs in a collection? Or another fix?
  • @pbragge: Same answer as above — if you just imported these and can tell us where they came from, we can see if we can work around the incorrect output or tell you how to do a find/replace in the file, and you can delete the entire batch of incorrect items at once.

    There's no way other than scripting to delete all editor fields. This is likely legitimate data that was just incorrectly formatted, so simply deleting it wouldn't be appropriate.
  • Thanks for the quick response. It's a complex ask because there were three databases searched, and (owing to Zotero's inability to remove duplicates in batches and the size of this library which is for a bibliographic analysis) the library has been deduplicated in Endnote, reimported, then had further duplicates removed within Zotero. However if you can indicate which of these databases is likely to be the culprit we can probably work with just that database output - APA PsycInfo; Scopus; and ProQuest Social Science Premium
  • edited February 1, 2023
    No, if you just save via the Zotero Connector this should pretty much never happen. If it does, and you can reproduce it now saving one of the affected items from one of the original sites, we'd want to know. But it was almost certainly the process of transferring the items via EndNote that did it. If you still have the RIS/BibTeX/etc. file you exported from EndNote, you can open that in a text editor (e.g., Notepad or TextEdit), find the record for one of the affected items, and post it here so we can look at it and tell you how to fix them in batch.
  • I know this is not to do with endnote because previous uploads direct into Zotero have had the same issue. I can send you the information you require shortly.
  • I have reproduced the error with a direct import from the .ris file into a shared document collection. The field generating the error is the 'editor' field which should not even exist for a journal article, and especially since the journal article in question has only one author (https://academic.oup.com/socpro/article-abstract/60/3/302/1680066?redirectedFrom=fulltext). I'd love to share the output of the text edit, but I can't because it exceeds the character limit for this chat. But I can tell you that the error appears to be that the entire reference list of the article is being imported and jammed somehow into the 'editor' field.

    Here's a truncated excerpt of the output. Can you please tell me how I can upload / otherwise share files in this forum?

    118.
    TY - JOUR
    ID - 2013-28549-002
    DO - https://dx.doi.org/10.1525/sp.2013.60.3.302
    T1 - Constructing the model immigrant: Movement strategy and immigrant deservingness in the New Sanctuary Movement.
    A1 - Yukich, Grace
    A2 - Alba, Allman, Avery, Batstone, Benford, Benford, Brotherton, Calavita, Capetillo-Ponce, Chavez, Chin, Chiricos, Chong, Corrigall-Brown, Cunningham, Dalton, Diani, Edelman, Foner, Fox, Fried, Fujiwara, Gilens, Goffman, Halfmann, Hays, Hondagneu-Sotelo, Hondagneu-Sotelo, Hoose, Jasper, Jasper, Kane, Kapur, Kim, Kim, King, Lee, Leitz, Marrow, Matesan, Min, Nepstad, O'Reilly, Ovando, Page, Pallares, Paschel, Perez, Petersen, Portes, Preston, Puga, Reese, Saito, Smith, Smith, Smith, Snow, Staudt, Tichenor, Voss, Warner, Waters, Welch, Welch, Wellman, Wuthnow, Yoo, Yoon, Yukich, Yukich
    Y1 - 2013//
    N1 - Annual Meeting of the American Sociological Association. 2010. A previous version of this article was presented at the aforementioned conference.
    N2 - The model minority stereotype has been widely criticized for creating distinctions between racial groups by depicting some as more deserving than others. Immigration scholars have begun exploring similar distinctions among immigrant groups, with most research highlighting the role of anti-immigrant forces, the media, and policymakers in constructing divisions. Ethnographic research on the New Sanctuary Movement, a network of interfaith immigrant rights organizations, reveals that pro-immigrant activists also construct distinctions between "deserving" and "undeserving" immigrants. Building on frame alignment theory, which often focuses on movement discourse, I use a dramaturgical approach to highlight the nonrhetorical framing practices involved in creating these distinctions: in particular, the casting of select members of stigmatized groups and their public and visual association with more powerful actors. Through a type of frame transformation I call the model movement strategy-the use of model cases to challenge negative stereotypes of members of disadvantaged groups-New Sanctuary activists drew distinctions between model immigrants and those who did not share their dominant-friendly characteristics, implicitly portraying certain undocumented immigrants as less deserving of legal residency and citizenship. These findings suggest that the model movement strategy, an approach used by a variety of contemporary social movements, may have insidious consequences for the most vulnerable movement constituents. (PsycInfo Database Record (c) 2021 APA, all rights reserved)
    KW - *Activism
    KW - *Immigration
    KW - *Policy Making
    KW - *Racial and Ethnic Groups
    KW - *Social Movements
    KW - Stereotyped Attitudes
    KW - Strategies
    M3 - Social Processes & Social Issues [2900]
    JF - Social Problems
    VL - 60
    IS - 3
    SP - 302
    EP - 320
    CY - US
    PB - University of California Press
    PB - US
    SN - 0037-7791
    AD - Yukich, Grace: Quinnipiac University, Department of Sociology, 275 Mount Carmel Ave., Hamden, CT, US, 06518, grace.yukich@quinnipiac.edu
    AD - Yukich, Grace: grace.yukich@quinnipiac.edu
    M1 - Alba, R., & Nee, V. 1997. "Rethinking Assimilation Theory for a New Era of Immigration." International Migration Review 31:826-74.
    M1 - Allman, D. D., & Beaty, M. D. (eds.). 2002. Cultivating Citizens: Soulcraft and Citizenship in Contemporary America. Lanham, MD: Lexington Books.
    M1 - Avery, J. M., & Peffley, M. 2003. "Race Matters: The Impact of News Coverage of Welfare Reform on Public Opinion." Pp. 131-50 in Race and the Politics of Welfare Reform, edited by S. Schram, J. Soss, and R. Fording. Ann Arbor: University of Michigan Press.
    M1 - Batstone, D., & Mendieta, E. (eds.). 1999. The Good Citizen. London, UK: Routledge.
    M1 - Benford, R. D., & Snow, D. A. 2000. "Framing Processes and Social Movements: An Overview and Assessment." Annual Review of Sociology 26:611-39.
    M1 - Benford, R. D., & Hunt, S. A. 1992. "Dramaturgy and Social Movements: The Social Construction and Communication of Power." Sociological Inquiry 62:36-55.
  • There are numerous other refs preceded by 'M1'
  • edited February 1, 2023
    But that's not the RIS output from that OUP page? The RIS from that page doesn't have that problem. So I'm not sure where you're getting that RIS file.

    In any case, that's obviously just incorrect RIS output from wherever you're getting it, and you'd want to report it to the source in question. Zotero is handling it according to the RIS spec, which for A2 and similar fields says, "Each author must be on a separate line, preceded by the tag that corresponds to the author role".

    (We could consider truncating automatically at 255 characters, since the RIS spec also says that it "can contain up to 255 characters for each field", but a better solution would probably be to add a wizard like we have for long tags that allows splitting/deleting incorrectly concatenated strings like these, since sometimes these might be valid authors or editors.)

    You could fix this with find/replace in the file, but since you've already imported it, here's some code to fix it. Select all potentially affected items in Zotero and run this from Tools → Developer → Run JavaScript, which should delete any creators with a Last Name field longer than 255 characters:

    var items = ZoteroPane.getSelectedItems();
    for (let item of items) {
    if (!item.isRegularItem()) continue;
    let modified = false;
    for (let i = 0; i < item.getCreators().length; i++) {
    if (item.getCreators()[i].lastName.length > 255) {
    item.removeCreator(i);
    i--;
    modified = true;
    }
    }
    if (modified) {
    await item.saveTx();
    }
    }


    I'd recommend making a backup of zotero.sqlite in your Zotero data directory and temporarily disabling auto-sync before running it.
  • Thanks for this. I'll try the code. Our experienced librarian generates the .ris files from the database searches. I take your point that we should follow up with the database; however it seems that other reference managers can handle this. I exported the entire Zotero library as a .ris file and imported that file into Mendeley. The library in Mendeley did not have that issue, and was able to sync with the online Mendeley library. I then exported the file from Mendeley and examined the output. The original .ris error was still there, but Mendeley obviously has an automatic fix. It would be great if Zotero could also use this code. I transferred from Mendeley to Zotero because they are no longer supporting the desktop version; but if I have to use code and go back and forth with databases to make library syncing work I may have to reconsider this decision.
  • ps I have run the code but it doesn't seem to have done anything. the message I get is "===>undefined<=== (undefined)"

    Can you also tell me how to disable sync?
  • I mean, I explained the issue above. Zotero can "handle" the field in that it will import it as the RIS spec requires. But we don't allow syncing creator fields longer than 255, because there has to be some limit to the database field, and a creator longer than 255 characters would always be incorrect. And as long as the value is in the field, depending on the citation style you're using the entire value may be placed in the reference, which you obviously don't want. So you have to fix it one way or the other, and there's not all that much point in making it possible to sync a value that's obviously wrong and needs to be fixed for correct citations.

    As I say, it might be nice if Zotero showed a wizard to make it easier to split these up or delete them, but you have to fix them one way or another, and it'd be better to just have valid RIS data. Again, the RIS data from the OUP page is correct, so you should ask your librarian to export from somewhere that doesn't do this, report it to whatever site they're using, or just fix the file with find/replace.

    The code does what I said it does: delete any creators in the selected items with a Last Name field longer than 255 characters.

    You can temporarily disable auto-sync from the Sync pane of the Zotero preferences. But if you already ran the code with items selected, it already should've deleted the long creators and there wouldn't be any reason to disable auto-sync.
  • I have disabled syncing, selected all the articles in the library and run the code. All that happens is I get the message "===>undefined<=== (undefined)" . How long should I allow for this code to work through the library (10,030 citations) and how can I check if it is running or not?
  • Just look at the items. You can test it on a single item to see what it does.
  • This works for me to split the names into individual creators, but very much do backup before trying this, and very much try it on a few single items first

    for (let item of ZoteroPane.getSelectedItems()) {
    if (!item.isRegularItem()) continue

    let modified = false
    var creators = []
    for (const creator of item.getCreators()) {
    if (creator.lastName.length <= 255) {
    creators.push(creator)
    }
    else {
    for (const lastName of creator.lastName.split(/\s*,\s*/).filter(n => n)) {
    creators.push({ creatorTypeID: creator.creatorTypeID, lastName })
    }
    modified = true
    }
    }
    if (modified) {
    item.setCreators(creators)
    await item.saveTx()
    }
    }
  • (These names don’t belong on the item at all, though — that’s why I gave code to delete them.)
  • So having run the original code from dstillman I still cannot sync the library. The error messages have gone, but the online version of the library has only 1034 citations; the desktop version has over 10,000. The syncing seems stuck.
  • Thanks - I forgot to unpause syncing before running the code. Once it got going again I encountered the original problem again. So I turned sync off and ran the code on the item flagged in isolation, then the whole library. Both times I got the same message on the 'return value' pane:

    ===>undefined<=== (undefined)

    Do you have any suggestions as to what this means, and / or alternative codes that address this issue?
  • Don't worry about that — you've mentioned that twice already, and I'd obviously tell you if it was wrong. As I've said, just look at the long creator in the item you've selected. If the Last Name is longer than 255 characters, it should just disappear when you run this code. (If the problem is in the First Name field, this code would need to be adjusted slightly.)
  • The problem is in the 'editor' field. Here's an example;

    Editor first name field: Apple

    Editor second name field: Apple Apple Asher Bell Bennett Bennett Brand Cabezas Chan Chan Chin Chun Coleman Crystal Freeman Fuller Greer Hamamota Herrnstein Hoare Kohn Koo Kozol Lawler Lee Lee Lee Mathis Min Oxnam Paige Perie Perie Peterson Peterson Ramirez Richards Ryan Scott Shin Silberman Sirotnik Sleeter Spring Suzuki Suzuki Takagi Tang Teranishi Teranishi Toppo Tsukada Wells Wong Wright Yin

    However, this problem has not disappeared when running the code.
  • edited February 21, 2023
    The two creator fields are "(last)" and "(first)". Which are you saying is the long one?

    Anyway, run this code, which will check both fields, and let us know what it gives for a result:

    var log = [];
    var items = ZoteroPane.getSelectedItems();
    for (let item of items) {
    if (!item.isRegularItem()) continue;
    log.push("===========\nChecking " + item.getDisplayTitle());
    let modified = false;
    for (let i = 0; i < item.getCreators().length; i++) {
    let creator = item.getCreators()[i];
    let creatorStr = `'${creator.firstName}' '${creator.lastName}'`;
    if (creator.firstName.length > 255 || creator.lastName.length > 255) {
    log.push(` - Removing ${creatorStr}`);
    item.removeCreator(i);
    i--;
    modified = true;
    }
    else {
    log.push(` - Not removing ${creatorStr}`);
    }
    }
    if (modified) {
    await item.saveTx();
    }
    }
    return log.join("\n");
  • it's the 'first' name field that is too long. Thanks for the code - it has worked on a single item! now running it for the library. Return msg below

    Checking Challenging the politics of the "model minority" stereotype: A case for educational equality
    - Not removing 'Tianlong' 'Yu'
    - Removing 'Apple Apple Asher Bell Bennett Bennett Brand Cabezas Chan Chan Chin Chun Coleman Crystal Freeman Fuller Greer Hamamota Herrnstein Hoare Kohn Koo Kozol Lawler Lee Lee Lee Mathis Min Oxnam Paige Perie Perie Peterson Peterson Ramirez Richards Ryan Scott Shin Silberman Sirotnik Sleeter Spring Suzuki Suzuki Takagi Tang Teranishi Teranishi Toppo Tsukada Wells Wong Wright Yin' 'Apple'
  • Hi dstillman - thanks again for the code. I've now run it across the library (had to do it in a few batches) and it has now fully synced with the online version - no mean feat with a library over 10,000 citations!
  • edited February 7, 2023
    OK, great. (The issue, to be clear, was just that the original code only checked the Last Name field, as I mentioned. The second version ran on both fields.)
  • Hi Folks, Is there a quick fix for this for the non-coders among us? I also have an exported APA PsycInfo list of about 250+ papers and the first name of the editor is always too long because it contains a long list of authors. Any fix that doesn't involve individual amendments to each paper?
  • You don't need to code for this -- you just need to copy & paste code and press run -- specifically, select all relevant items, go to Tools → Developer → Run JavaScript in Zotero, paste the code in dstillman's last post there and click run. You can test on one item if you're nervous.
  • Thanks. I managed to remove them manually after I sent my previous message. Hopefully a bug that APA PsycInfo can resolve.
Sign In or Register to comment.