Fix duplicated fields when object is converted into array

pull/20/head
Aleksander Machniak 12 years ago
parent c4841d73db
commit 6ec3844790

@ -583,8 +583,13 @@ function rcmail_contact_form($form, $record, $attrib = null)
if (empty($values) && $colprop['visible'])
$values[] = '';
if (!is_array($values)) {
// $values can be an object, don't use (array)$values syntax
$values = !empty($values) ? array($values) : array();
}
$rows = '';
foreach ((array)$values as $i => $val) {
foreach ($values as $i => $val) {
if ($subtypes[$i])
$subtype = $subtypes[$i];
@ -641,7 +646,7 @@ function rcmail_contact_form($form, $record, $attrib = null)
$val = $colprop['options'][$val];
else
$val = Q($val);
console($val);
// use subtype as label
if ($colprop['subtypes'])
$label = rcmail_get_type_label($subtype);

Loading…
Cancel
Save