From 6689578d5273f0a6145e5ea0409a7c292614863f Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 6 Jun 2012 17:00:15 +0000 Subject: [PATCH] Sometimes ID can get set to an empty array by server side - don't count that, look up the tree --- etemplate/js/et2_widget_selectbox.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/etemplate/js/et2_widget_selectbox.js b/etemplate/js/et2_widget_selectbox.js index e810345d53..a8e3c8b03f 100644 --- a/etemplate/js/et2_widget_selectbox.js +++ b/etemplate/js/et2_widget_selectbox.js @@ -118,8 +118,13 @@ var et2_selectbox = et2_inputWidget.extend({ // Try first according to ID content_options = this.getArrayMgr("sel_options").getEntry(this.id); + // ID can get set to an array with 0 => ' ' - not useful + if(content_options && content_options.length == 1 && typeof content_options[0] != 'undefined' && content_options[0].trim() == '') + { + content_options = null; + } - // Select options tend to be defined once, at the top level, so try that first + // Select options tend to be defined once, at the top level, so try that if(!content_options || content_options.length == 0) { content_options = this.getArrayMgr("sel_options").getRoot().getEntry(name_parts[name_parts.length-1]);