Fix PHP warning when adding contact to a group (Bug #1989)
This commit is contained in:
parent
cab58ba233
commit
bba45ce59d
2 changed files with 16 additions and 11 deletions
|
@ -821,8 +821,15 @@ class rcube_kolab_contacts extends rcube_addressbook
|
|||
foreach ($ids as $contact_id) {
|
||||
$uid = $this->id2uid($contact_id);
|
||||
if ($contact = $this->storagefolder->get_object($uid)) {
|
||||
foreach ($this->get_col_values('email', $contact, true) as $email)
|
||||
$email = '';
|
||||
if (empty($uid)) {
|
||||
foreach ($contact['email'] as $email) {
|
||||
if (is_array($email)) {
|
||||
$email = $email['address'];
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$list['member'][] = array(
|
||||
'uid' => $uid,
|
||||
|
|
|
@ -44,7 +44,6 @@ class kolab_format_distributionlist extends kolab_format
|
|||
|
||||
$this->obj->setName($object['name']);
|
||||
|
||||
$seen = array();
|
||||
$members = new vectorcontactref;
|
||||
foreach ((array)$object['member'] as $member) {
|
||||
if ($member['uid'])
|
||||
|
@ -56,7 +55,6 @@ class kolab_format_distributionlist extends kolab_format
|
|||
|
||||
$m->setName($member['name']);
|
||||
$members->push($m);
|
||||
$seen[$member['email']]++;
|
||||
}
|
||||
|
||||
$this->obj->setMembers($members);
|
||||
|
@ -100,7 +98,7 @@ class kolab_format_distributionlist extends kolab_format
|
|||
$members = $this->obj->members();
|
||||
for ($i=0; $i < $members->size(); $i++) {
|
||||
$member = $members->get($i);
|
||||
# if ($member->type() == ContactReference::UidReference && ($uid = $member->uid()))
|
||||
// if ($member->type() == ContactReference::UidReference && ($uid = $member->uid()))
|
||||
$object['member'][] = array(
|
||||
'uid' => $member->uid(),
|
||||
'email' => $member->email(),
|
||||
|
|
Loading…
Add table
Reference in a new issue