diff --git a/chrome/content/zotero/xpcom/openurl.js b/chrome/content/zotero/xpcom/openurl.js index 19d630cbf..b70924dce 100644 --- a/chrome/content/zotero/xpcom/openurl.js +++ b/chrome/content/zotero/xpcom/openurl.js @@ -358,14 +358,14 @@ Zotero.OpenURL = new function() { if(complexAu.length && !lastCreator.lastName && !lastCreator.institutional) { lastCreator.lastName = value; } else { - complexAu.push({lastName:value, creatorType:(key == "rft.aulast" ? "author" : "inventor")}); + complexAu.push({lastName:value, creatorType:(key == "rft.aulast" ? "author" : "inventor"), offset:item.creators.length}); } } else if(key == "rft.aufirst" || key == "rft.invfirst") { var lastCreator = complexAu[complexAu.length-1]; if(complexAu.length && !lastCreator.firstName && !lastCreator.institutional) { lastCreator.firstName = value; } else { - complexAu.push({firstName:value, creatorType:(key == "rft.aufirst" ? "author" : "inventor")}); + complexAu.push({firstName:value, creatorType:(key == "rft.aufirst" ? "author" : "inventor"), offset:item.creators.length}); } } else if(key == "rft.au" || key == "rft.creator" || key == "rft.contributor" || key == "rft.inventor") { if(key == "rft.contributor") { @@ -439,10 +439,16 @@ Zotero.OpenURL = new function() { } } } + + // To maintain author ordering when complex and simple authors are combined, + // we remember where they were and the correct offsets + var inserted = 0; // combine two lists of authors, eliminating duplicates for(var i=0; i