diff options
author | thomascube <thomas@roundcube.net> | 2011-12-04 16:57:40 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2011-12-04 16:57:40 +0000 |
commit | b885ab73b81d344125b41115a885c9ada40386bc (patch) | |
tree | 4b091246bb4f49de32e921806e906384a4561cd8 /program/steps/addressbook/save.inc | |
parent | 5d692ba85ccbcb3f3a2722e026469ada2afc5c9c (diff) |
Fix saving of composite address fields without subtype
Diffstat (limited to 'program/steps/addressbook/save.inc')
-rw-r--r-- | program/steps/addressbook/save.inc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/program/steps/addressbook/save.inc b/program/steps/addressbook/save.inc index 0a2d6dbff..03f6671e6 100644 --- a/program/steps/addressbook/save.inc +++ b/program/steps/addressbook/save.inc @@ -50,10 +50,12 @@ foreach ($GLOBALS['CONTACT_COLTYPES'] as $col => $colprop) { foreach ((array)$vals as $i => $val) $values[$i][$childcol] = $val; } - $subtypes = get_input_value('_subtype_' . $col, RCUBE_INPUT_POST); - foreach ($subtypes as $i => $subtype) + $subtypes = isset($_REQUEST['_subtype_' . $col]) ? (array)get_input_value('_subtype_' . $col, RCUBE_INPUT_POST) : array(''); + foreach ($subtypes as $i => $subtype) { + $suffix = $subtype ? ':'.$subtype : ''; if ($values[$i]) - $a_record[$col.':'.$subtype][] = $values[$i]; + $a_record[$col.$suffix][] = $values[$i]; + } } // assign values and subtypes else if (is_array($_POST[$fname])) { |