Skip to content

Commit

Permalink
Fixed bug where 'shortName' in the EML was causing validation errors …
Browse files Browse the repository at this point in the history
…in the editor
  • Loading branch information
laurenwalker committed Jun 25, 2019
1 parent 209811f commit 6a2cae7
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/js/models/metadata/eml211/EML211.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ define(['jquery', 'underscore', 'backbone', 'uuid',
"researchtopic" : "researchTopic",
"recorddelimiter" : "recordDelimiter",
"samplingdescription" : "samplingDescription",
"shortname" : "shortName",
"simpledelimited" : "simpleDelimited",
"standardunit" : "standardUnit",
"storagetype" : "storageType",
Expand Down Expand Up @@ -471,16 +472,13 @@ define(['jquery', 'underscore', 'backbone', 'uuid',
}
});

// Insert new nodes
if (fieldName.toLowerCase() === "alternateidentifier") {
datasetNode.prepend(nodes);
var insertAfter = this.getEMLPosition(eml, fieldName.toLowerCase());

if(insertAfter){
insertAfter.after(nodes);
}
else if (fieldName.toLowerCase() === "title") {
if (datasetNode.find("alternateidentifier").length > 0) {
datasetNode.find("alternateidentifier").last().after(nodes);
} else {
datasetNode.prepend(nodes);
}
else{
datasetNode.prepend(nodes);
}

}, this);
Expand Down

0 comments on commit 6a2cae7

Please sign in to comment.