Fix getting first writeable address book if no default is configured

release-0.6
thomascube 14 years ago
parent 03eb13f11c
commit 3a9f7954ba

@ -30,8 +30,9 @@ $CONTACTS = $RCMAIL->get_address_book($abook, true);
// Get first writeable addressbook if the configured doesn't exist // Get first writeable addressbook if the configured doesn't exist
// This can happen when user deleted the addressbook (e.g. Kolab folder) // This can happen when user deleted the addressbook (e.g. Kolab folder)
if ($abook !== null && !is_object($CONTACTS)) { if ($abook == null || !is_object($CONTACTS)) {
$CONTACTS = $RCMAIL->get_address_book(null, true); $source = reset($RCMAIL->get_address_sources(true));
$CONTACTS = $RCMAIL->get_address_book($source['id'], true);
} }
if (!empty($_POST['_address']) && is_object($CONTACTS)) if (!empty($_POST['_address']) && is_object($CONTACTS))

Loading…
Cancel
Save