Secondary sort not working; sorts randomly.

I have the middle pane set to show: Title, Journal Abbreviation, Creator, and Year. The Journal Abbreviation column is just there for information, and I sort by (1) Creator and then (2) Year. However, I just noticed today (I am a new user, just testing out the waters) that the secondary sorting is not correct and it seems to be quite random as far as I can tell.

For example, I have three papers with a first author of Smith, James, with a varying number of coauthors. They've published papers in 1982, 1983, and 1994. My expectation is that it will sort them as so:

- Smith et al., 1982
- Smith et al., 1983
- Smith et al., 1994

But, the reality is that Zotero sorts them like this:

- Smith et al., 1983
- Smith et al., 1994
- Smith et al., 1982

This is clearly wrong and makes no sense. It's not even in reverse year order, it's simply wrong. I have double checked the author name entry for Smith to make sure that I didn't make some typo in his name that would cause it to sort wrong, but even after copy-pasting his name into all three papers it still sorts it this way.

At the same time, I believe that the secondary sorting order by year is also wrong for other cases where I only have two papers published by the same first author.

In one case I have the following sort order:

- Houston et al., 2002
- Houston et al., 2003

Which appears to be correct, but then I have:

- Hudson et al., 2003
- Hudson et al., 1998

Which is not correct because it's backwards, or at the very least not consistent.

Finally, I have this case by another author where he has a single author paper, followed by two papers with multiple authors where he's the first author. Here is how Zotero sorts it:

- Jackson et al., 2008
- Jackson et al., 2009
- Jackson, 2006

At this point I can not tell what Zotero's intention was in sorting these three papers. Did Zotero mean to place Jackson, 2006 at the end on purpose? Or did Zotero just do it wrong, like in my first example?
  • When you sort by Creator in the middle pane, Zotero by default doesn't just sort by what you see — it sorts by all the creators. So if you have an item from 2016 with authors Smith, Adams, and Johnson, that will sort before an item from 2010 with authors Smith, Johnson, and Adams.

    To get the behave you're looking for, you can open about:config from the Advanced pane of the Zotero preferences, search for extensions.zotero.sortCreatorAsString, and change it to true.
    Finally, I have this case by another author where he has a single author paper, followed by two papers with multiple authors where he's the first author. Here is how Zotero sorts it:

    - Jackson et al., 2008
    - Jackson et al., 2009
    - Jackson, 2006
    This one probably qualifies as a bug, though — with sortCreatorAsString off, a single creator should probably sort before multiple. I've created an issue for that.
  • Actually, that last one seems to be fixed for 5.0 (the next major version) already.
  • Thanks Dan. It makes sense now that you explain it though perhaps it's not so intuitive. The hidden preference changed it to behave the way I imaged it would. I did check the wiki to see if there was a hidden option for this but it's not listed. I would add it but I'm not sure if it's a "safe" option to change because I don't know how it affects the rest of the program. Thanks again though.
  • I changed extensions.zotero.sortCreatorAsString to "true" and got the changed behavior as described here (which is generally what I want). However, it seems that if there are entries with one or two authors, those are grouped and sorted together before entries with three or more authors. I would like all entries to be sorted by first author then year, regardless of how many authors are on a paper. Is this possible?
  • @quagman: Not quite what you mean. sortCreatorAsString means what it says — it sorts the Creator string as a literal string. So it wouldn't be about the number of creators and would instead be about "and" (which appears for two authors) sorting before "et al." (which appears for three or more). If you think you're seeing different, we'd need to see examples.
  • Ok that makes sense. I think I can work around that.
Sign In or Register to comment.