Skip to content

Commit

Permalink
Translate string to array for multi fields in getControlsState
Browse files Browse the repository at this point in the history
  • Loading branch information
michellethomas committed May 22, 2018
1 parent 4c44223 commit 9110b41
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions superset/assets/src/explore/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ export function getControlsState(state, form_data) {
delete control.mapStateToProps;
}

if (control.multi && typeof formData[k] === 'string') {
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]);
Expand Down

0 comments on commit 9110b41

Please sign in to comment.