From f8f586eeabab100d4438f13358648faaa700bdbf Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 22 Sep 2015 16:05:27 +0000 Subject: [PATCH] Do not die if select custom field is not fully set up --- admin/inc/class.customfields.inc.php | 1 + etemplate/js/et2_extension_customfields.js | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/admin/inc/class.customfields.inc.php b/admin/inc/class.customfields.inc.php index 0d56406f4e..602296728d 100644 --- a/admin/inc/class.customfields.inc.php +++ b/admin/inc/class.customfields.inc.php @@ -68,6 +68,7 @@ class customfields * @var Description of the options or value format for each cf_type */ public static $type_option_help = array( + 'search' => 'set get_rows, get_title and id_field, or use @path to read options from a file in EGroupware directory', 'select' => 'each value is a line like id[=label], or use @path to read options from a file in EGroupware directory', 'radio' => 'each value is a line like id[=label], or use @path to read options from a file in EGroupware directory', 'button' => 'each value is a line like label=[javascript]' diff --git a/etemplate/js/et2_extension_customfields.js b/etemplate/js/et2_extension_customfields.js index dcbae50553..fa54dada41 100644 --- a/etemplate/js/et2_extension_customfields.js +++ b/etemplate/js/et2_extension_customfields.js @@ -438,11 +438,14 @@ var et2_customfields_list = et2_valueWidget.extend([et2_IDetachedDOM, et2_IInput }, _setup_ajax_select: function(field_name, field, attrs) { var attributes = ['get_rows','get_title','id_field','template']; - for(var i = 0; i < attributes.length; i++) + if(field.values) { - if(typeof field.values[attributes[i]] !== 'undefined') + for(var i = 0; i < attributes.length; i++) { - attrs[attributes[i]] = field.values[attributes[i]]; + if(typeof field.values[attributes[i]] !== 'undefined') + { + attrs[attributes[i]] = field.values[attributes[i]]; + } } } return true;