From 7baf298bf7a28a0900c6c41ac68b1651abdea636 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 25 Apr 2016 20:02:58 +0000 Subject: [PATCH] Keep value if et2 tried to set it before select_options were there, and it got stripped out --- api/js/etemplate/et2_widget_selectbox.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/api/js/etemplate/et2_widget_selectbox.js b/api/js/etemplate/et2_widget_selectbox.js index 7bef24d08f..aad50f1145 100644 --- a/api/js/etemplate/et2_widget_selectbox.js +++ b/api/js/etemplate/et2_widget_selectbox.js @@ -807,7 +807,15 @@ var et2_selectbox = (function(){ "use strict"; return et2_inputWidget.extend( this.input.trigger("liszt:updated"); } // Sometimes value gets set before options - if(this.value || this.options.empty_label) this.set_value(this.value, true); // true = dont try to set_options, to avoid an infinit recursion + if(this.value || this.options.empty_label) + { + this.set_value(this.value, true); // true = dont try to set_options, to avoid an infinit recursion + } + else if (this.value === null && this.options.value) + { + // Null means it tried to set the value, and it got stripped by missing options + this.set_value(this.options.value, true) + } }, getValue: function() {