From 1aaa73b54803094eba73d29800c06d56708e1966 Mon Sep 17 00:00:00 2001 From: michellethomas Date: Wed, 23 May 2018 22:30:44 -0700 Subject: [PATCH] Translate string to array for multi fields in getControlsState (#5057) * Translate string to array for multi fields in getControlsState * Updating format to fit on one line --- superset/assets/src/explore/store.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/superset/assets/src/explore/store.js b/superset/assets/src/explore/store.js index 4f1e7b5612..32c132fd42 100644 --- a/superset/assets/src/explore/store.js +++ b/superset/assets/src/explore/store.js @@ -56,6 +56,9 @@ export function getControlsState(state, form_data) { delete control.mapStateToProps; } + formData[k] = (control.multi && formData[k] && !Array.isArray(formData[k])) ? [formData[k]] + : formData[k]; + // If the value is not valid anymore based on choices, clear it if (control.type === 'SelectControl' && control.choices && k !== 'datasource' && formData[k]) { const choiceValues = control.choices.map(c => c[0]);