Skip to content

Commit

Permalink
Fix bug with serializing EMLParties
Browse files Browse the repository at this point in the history
Closes #1203
  • Loading branch information
laurenwalker committed Dec 4, 2019
1 parent dc2110d commit 0d7c3ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/js/models/metadata/eml211/EMLParty.js
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ define(['jquery', 'underscore', 'backbone', 'models/DataONEObject'],
// Remove empty (zero-length or whitespace-only) nodes
$(objectDOM).find("*").filter(function() { return $.trim(this.innerHTML) === ""; } ).remove();

return objectDOM[0];
return objectDOM;
},

/*
Expand Down
4 changes: 2 additions & 2 deletions src/js/models/portals/PortalModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -881,8 +881,8 @@ define(["jquery",
_.each(parties, function(party){

// Update the DOM of the EMLParty
var partyEl = party.updateDOM(),
partyDoc = $.parseXML(party.formatXML(partyEl));
var partyEl = party.updateDOM();
partyDoc = $.parseXML(party.formatXML( $(partyEl)[0] ));

// Make sure we don't insert empty EMLParty nodes into the EML
if(partyDoc.childNodes.length){
Expand Down

0 comments on commit 0d7c3ab

Please sign in to comment.