Aleksander Machniak
2012-08-03 6ec384479029dd15022e1ffde18bd4ceefc3bae3
Fix duplicated fields when object is converted into array
1 files modified
9 ■■■■ changed files
program/steps/addressbook/func.inc 9 ●●●● patch | view | raw | blame | history
program/steps/addressbook/func.inc
@@ -583,8 +583,13 @@
                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 @@
                        $val = $colprop['options'][$val];
                    else
                        $val = Q($val);
console($val);
                    // use subtype as label
                    if ($colprop['subtypes'])
                        $label = rcmail_get_type_label($subtype);