mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-03-05 07:44:01 +01:00
Fix empty name in search results and error when creating a new contact
This commit is contained in:
@@ -200,10 +200,13 @@ class rcube_contacts extends rcube_addressbook
|
||||
$sql_arr = $this->convert_db_data($sql_arr);
|
||||
else
|
||||
$sql_arr['email'] = preg_split('/,\s*/', $sql_arr['email']);
|
||||
|
||||
|
||||
// make sure we have a name to display
|
||||
if (empty($sql_arr['name']))
|
||||
if (empty($sql_arr['name'])) {
|
||||
if (empty($sql_arr['email']))
|
||||
$sql_arr['email'] = $this->get_col_values('email', $sql_arr, true);
|
||||
$sql_arr['name'] = $sql_arr['email'][0];
|
||||
}
|
||||
|
||||
$this->result->add($sql_arr);
|
||||
}
|
||||
|
||||
@@ -348,7 +348,7 @@ function rcmail_contact_form($form, $record, $attrib = null)
|
||||
$content = '';
|
||||
|
||||
// unset display name if it is composed from name parts (same composition function as in save.inc)
|
||||
if ($record['name'] == rcube_addressbook::compose_display_name(array('name' => '') + $record))
|
||||
if ($record['name'] == rcube_addressbook::compose_display_name(array('name' => '') + (array)$record))
|
||||
unset($record['name']);
|
||||
|
||||
// group fields
|
||||
|
||||
Reference in New Issue
Block a user