mirror of
https://github.com/owncloudarchive/contacts.git
synced 2024-12-01 13:24:10 +01:00
commit
f6804bac15
@ -171,11 +171,10 @@ class Addressbook extends AbstractPIMCollection {
|
||||
);
|
||||
}
|
||||
|
||||
if (!isset($this->objects[$id])) {
|
||||
if (!isset($this->objects[(string)$id])) {
|
||||
$contact = $this->backend->getContact($this->getId(), $id);
|
||||
if ($contact) {
|
||||
//$this->objects[$id] = new Contact($this, $this->backend, $contact);
|
||||
$curContact = new Contact($this, $this->backend, $contact);
|
||||
$this->objects[(string)$id] = new Contact($this, $this->backend, $contact);
|
||||
} else {
|
||||
throw new \Exception(
|
||||
self::$l10n->t('Contact not found'),
|
||||
@ -185,10 +184,9 @@ class Addressbook extends AbstractPIMCollection {
|
||||
}
|
||||
|
||||
// When requesting a single contact we preparse it
|
||||
if (isset($curContact)) {
|
||||
$curContact->retrieve();
|
||||
$this->objects[$id] = $curContact;
|
||||
return $curContact;
|
||||
if (isset($this->objects[(string)$id])) {
|
||||
$this->objects[(string)$id]->retrieve();
|
||||
return $this->objects[(string)$id];
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user