From 3a9f7954baf92a40ee149c8d0acc3e56826945ff Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Mon, 18 Jul 2011 12:57:15 -0400
Subject: [PATCH] Fix getting first writeable address book if no default is configured
---
program/steps/mail/addcontact.inc | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/program/steps/mail/addcontact.inc b/program/steps/mail/addcontact.inc
index 57bc2a1..b74d95f 100644
--- a/program/steps/mail/addcontact.inc
+++ b/program/steps/mail/addcontact.inc
@@ -30,8 +30,9 @@
// 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))
--
Gitblit v1.9.1