summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-07-18 16:57:15 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-07-18 16:57:15 +0000
commitd434f7141ad54d31a1a816f75fb974c56ff26936 (patch)
treec828f9787724920e86d908e55ee5f17bbdc67168
parentb772e0d375671deefe378fd2593523493bddced9 (diff)
Fix getting first writeable address book if no default is configured
git-svn-id: https://svn.roundcube.net/trunk@4933 208e9e7b-5314-0410-a742-e7e81cd9613c
-rw-r--r--roundcubemail/program/steps/mail/addcontact.inc5
1 files changed, 3 insertions, 2 deletions
diff --git a/roundcubemail/program/steps/mail/addcontact.inc b/roundcubemail/program/steps/mail/addcontact.inc
index 57bc2a1c6..b74d95faa 100644
--- a/roundcubemail/program/steps/mail/addcontact.inc
+++ b/roundcubemail/program/steps/mail/addcontact.inc
@@ -30,8 +30,9 @@ $CONTACTS = $RCMAIL->get_address_book($abook, true);
// Get first writeable addressbook if the configured doesn't exist
// This can happen when user deleted the addressbook (e.g. Kolab folder)
-if ($abook !== null && !is_object($CONTACTS)) {
- $CONTACTS = $RCMAIL->get_address_book(null, true);
+if ($abook == null || !is_object($CONTACTS)) {
+ $source = reset($RCMAIL->get_address_sources(true));
+ $CONTACTS = $RCMAIL->get_address_book($source['id'], true);
}
if (!empty($_POST['_address']) && is_object($CONTACTS))