diff --git a/mindplot/src/main/javascript/persistence/XMLSerializer_Pela.js b/mindplot/src/main/javascript/persistence/XMLSerializer_Pela.js index e1669a34..78bd4f3b 100644 --- a/mindplot/src/main/javascript/persistence/XMLSerializer_Pela.js +++ b/mindplot/src/main/javascript/persistence/XMLSerializer_Pela.js @@ -47,9 +47,14 @@ mindplot.persistence.XMLSerializer_Pela = new Class({ // Create Relationships var relationships = mindmap.getRelationships(); if (relationships.length > 0) { + for (var j = 0; j < relationships.length; j++) { - var relationDom = this._relationshipToXML(document, relationships[j]); - mapElem.appendChild(relationDom); + var relationship = relationships[j]; + if (mindmap.findNodeById(relationship.getFromNode()) !== null && mindmap.findNodeById(relationship.getToNode()) !== null) { + // Isolated relationships are not persisted .... + var relationDom = this._relationshipToXML(document, relationship); + mapElem.appendChild(relationDom); + } } } @@ -180,6 +185,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({ result.setAttribute("srcTopicId", relationship.getFromNode()); result.setAttribute("destTopicId", relationship.getToNode()); + var lineType = relationship.getLineType(); result.setAttribute("lineType", lineType); if (lineType == mindplot.ConnectionLine.CURVED || lineType == mindplot.ConnectionLine.SIMPLE_CURVED) { @@ -305,7 +311,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({ } var order = domElem.getAttribute('order'); - if ($defined(order) && order!="NaN") { // Hack for broken maps ... + if ($defined(order) && order != "NaN") { // Hack for broken maps ... topic.setOrder(parseInt(order)); } diff --git a/wise-webapp/src/test/resources/data/wisemaps/bug2.xml b/wise-webapp/src/test/resources/data/wisemaps/bug2.xml new file mode 100644 index 00000000..e69de29b