diff --git a/etemplate/inc/class.etemplate_widget_customfields.inc.php b/etemplate/inc/class.etemplate_widget_customfields.inc.php index e9028b8034..68e637cf79 100644 --- a/etemplate/inc/class.etemplate_widget_customfields.inc.php +++ b/etemplate/inc/class.etemplate_widget_customfields.inc.php @@ -203,6 +203,14 @@ class etemplate_widget_customfields extends etemplate_widget_transformer $fields_with_vals[]=$lname; } } + // need to encode values/select-options to keep their order + foreach($customfields as &$data) + { + if (!empty($data['values'])) + { + etemplate_widget_menupopup::fix_encoded_options($data['values']); + } + } if($fields != $customfields) { // This widget has different settings from global diff --git a/etemplate/inc/class.etemplate_widget_menupopup.inc.php b/etemplate/inc/class.etemplate_widget_menupopup.inc.php index 6f3fae2439..2448a40307 100644 --- a/etemplate/inc/class.etemplate_widget_menupopup.inc.php +++ b/etemplate/inc/class.etemplate_widget_menupopup.inc.php @@ -276,7 +276,7 @@ class etemplate_widget_menupopup extends etemplate_widget // so check here, as we re-index // Duplicates might happen if app programmer isn't paying attention and // either uses the same ID in the template, or adds the options twice - if(is_numeric($value) && (!is_array($label) || is_array($label) && !array_key_exists('value',$label))) + if(!is_array($label) || is_array($label) && !array_key_exists('value',$label)) { $check_value = (string)(is_array($label) && array_key_exists('value', $label) ? $label['value'] : $value); if((string)$value === $check_value)