parent
39d7f22981
commit
4e11c7927d
3 changed files with 14 additions and 1 deletions
|
@ -4212,6 +4212,8 @@ Zotero.Item.prototype.fromJSON = function (json, options = {}) {
|
|||
json.extra !== undefined ? json.extra : '',
|
||||
this,
|
||||
Object.keys(json)
|
||||
// TEMP until we move creator lines to real creators
|
||||
.concat('creators')
|
||||
);
|
||||
|
||||
// Transfer valid fields from Extra to regular fields
|
||||
|
|
|
@ -1050,7 +1050,7 @@ Zotero.Utilities.Internal = {
|
|||
}
|
||||
|
||||
let possibleCreatorType = creatorTypes.get(key);
|
||||
if (possibleCreatorType) {
|
||||
if (possibleCreatorType && !additionalFields.has('creators')) {
|
||||
let c = {
|
||||
creatorType: possibleCreatorType
|
||||
};
|
||||
|
|
|
@ -1811,6 +1811,17 @@ describe("Zotero.Item", function () {
|
|||
assert.equal(item.getField('extra'), `doi: ${doi2}`);
|
||||
});*/
|
||||
|
||||
it("should ignore creator field in Extra", async function () {
|
||||
var json = {
|
||||
itemType: "journalArticle",
|
||||
extra: "Author: Name"
|
||||
};
|
||||
var item = new Zotero.Item();
|
||||
item.fromJSON(json);
|
||||
assert.lengthOf(item.getCreatorsJSON(), 0);
|
||||
assert.equal(item.getField('extra'), json.extra);
|
||||
});
|
||||
|
||||
it("should store unknown fields in Extra in non-strict mode", function () {
|
||||
var json = {
|
||||
itemType: "journalArticle",
|
||||
|
|
Loading…
Reference in a new issue