Do not die if select custom field is not fully set up

This commit is contained in:
Nathan Gray 2015-09-22 16:05:27 +00:00
parent 9c699bc8e2
commit f8f586eeab
2 changed files with 7 additions and 3 deletions

View File

@ -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]'

View File

@ -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;