diff --git a/js/authoring/controllers/contextInfoController.js b/js/authoring/controllers/contextInfoController.js index eb6d2b67b475d7e0c5938e266e1b30c8fdb70fbd..096bc7dae6db5293179d63b31fe9cef6a535a827 100644 --- a/js/authoring/controllers/contextInfoController.js +++ b/js/authoring/controllers/contextInfoController.js @@ -37,7 +37,7 @@ function checkInformation() { }*/ // check selection bar "Operator" - if ( selectedOperator == null ) { + if ( selectedOperator == null || selectedOperator.id == "\r") { // if selection bar operator is empty, concatenate it in missing_content string missing_content += " - Operator\n"; } else { diff --git a/js/authoring/controllers/saveScenarioController.js b/js/authoring/controllers/saveScenarioController.js index 4403abe8d7d2234919d451454be2dc14bd87c224..38c41e2e5e72a37c4d31258cf49a300fd9c690b3 100644 --- a/js/authoring/controllers/saveScenarioController.js +++ b/js/authoring/controllers/saveScenarioController.js @@ -27,7 +27,7 @@ function showSaveScenario() { replaceScenarioReferencesWithNames(); // find current scenario in all scenarios - var json = authorSystemContent.getScenario(currentScenario); + var json = JSON.stringify(authorSystemContent.getScenario(currentScenario)); //var jsonLD = JSON.stringify(json ? json.getABoxJSONLD() : {}); // set blob with JSON data diff --git a/js/authoring/controllers/tabs/contextTabController.js b/js/authoring/controllers/tabs/contextTabController.js index eb634f0cce05ea363d30d46e9bb4e87082638346..328496ade43510a095c5ca1eed86689123e1e11c 100644 --- a/js/authoring/controllers/tabs/contextTabController.js +++ b/js/authoring/controllers/tabs/contextTabController.js @@ -599,6 +599,8 @@ function confirmContextInformation() { // check if all needed fields were filled with information and return selected context var selectedInfo = checkInformation(); + // abort if error occurred + if (!selectedInfo) return false; // add the new information to the context list of the currently selected unit current_unit.addContextInfo(selectedInfo, unitContextIndex); @@ -673,6 +675,8 @@ function confirmContextInformation() { // show main, hide detail showMainContextInfo(); + // workaround to avoid error message due to circular structure + replaceScenarioReferencesWithNames(); console.log(JSON.stringify(authorSystemContent)); } diff --git a/js/authoring/controllers/unitController.js b/js/authoring/controllers/unitController.js index f062e4f6b321e4fa6604d6ba7f15b6d59ed5ebe1..8731831aec397c06edb12c2ddd342d006efde5be 100644 --- a/js/authoring/controllers/unitController.js +++ b/js/authoring/controllers/unitController.js @@ -188,7 +188,8 @@ function initUnitClickEventHandler () { // prevents that underlying container is also clicked (needed for unit marking) event.stopPropagation(); - //console.log(myAuthorSystem); + // workaround to avoid error message due to circular structure + replaceScenarioReferencesWithNames(); console.log(JSON.stringify(authorSystemContent)); }); }