summaryrefslogtreecommitdiff
path: root/program/steps
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-08-03 11:28:28 +0200
committerAleksander Machniak <alec@alec.pl>2012-08-03 11:28:28 +0200
commit0ed7034d353cf0f2a3348a74c8562fdbbd1cff67 (patch)
tree0872d8909990baca54af305ac4f2f73f22d996de /program/steps
parent622bce2c09a8ea3d2de949b17ae0a1e2382bdcff (diff)
Fix duplicated fields when object is converted into array
Diffstat (limited to 'program/steps')
-rw-r--r--program/steps/addressbook/func.inc9
1 files changed, 7 insertions, 2 deletions
diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc
index 8abf061b8..a80240b65 100644
--- a/program/steps/addressbook/func.inc
+++ b/program/steps/addressbook/func.inc
@@ -580,8 +580,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];
@@ -638,7 +643,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);