From eac17076b43894a64e03e29097e7a20dc89c740f Mon Sep 17 00:00:00 2001
From: felmer <franz-josef.elmer@id.ethz.ch>
Date: Mon, 27 May 2019 12:38:23 +0200
Subject: [PATCH] SSDM-8241: Bug fixed by filtering null spaces out

---
 .../eln-lims/html/js/views/SettingsForm/SettingsFormView.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SettingsForm/SettingsFormView.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SettingsForm/SettingsFormView.js
index b6a1cf01bb1..70b340083c7 100644
--- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SettingsForm/SettingsFormView.js
+++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SettingsForm/SettingsFormView.js
@@ -273,7 +273,7 @@ function SettingsFormView(settingsFormController, settingsFormModel) {
 		
 		var spacesOptions = this._settingsFormController.getInventorySpacesOptions();
 			spacesOptions = JSON.parse(JSON.stringify(spacesOptions));
-		var initialValues = this._profileToEdit.inventorySpaces;
+		var initialValues = this._profileToEdit.inventorySpaces.filter(space => space);
 		
 		for(var i = 0; i < initialValues.length; i++) {
 			if($.inArray(initialValues[i], spacesOptions) === -1) {
@@ -753,7 +753,9 @@ function SettingsFormView(settingsFormController, settingsFormModel) {
 				for (var column of tableModel.columns) {
 					var $widget = row[column.label];
 					var value = this._getWidgetValue($widget);
-					rowValues[column.label] = value;
+					if (value) {
+						rowValues[column.label] = value;
+					}
 				}
 				if (tableModel.rowExtraModels.length === tableModel.rows.length) {
 					rowValues.extraValues = tableModel.rowExtraModels[i].getValues();
-- 
GitLab