Package: roundcube-plugins-extra
Version: 0.7-20120110
Severity: important

Wehn I double-click an email from the compose_addressbook popup, the email address is not added to the recepient list of the email, instead I get an entry that looks like this:

nik lutz <>

This makes this plugins unusable. The attached patch fixes the problem.

regards nik

--- compose_addressbook.php	2013-01-30 12:38:36.798171714 +0100
+++ compose_addressbook.php.new	2013-01-30 12:38:24.718280245 +0100
@@ -87,10 +87,13 @@
 
       if($mode == 'full') {
         $result = $abook->list_records();
-        while ($sql_arr = $result->iterate()) {
-          if($sql_arr['name'] == '') $sql_arr['name'] = $sql_arr['email'];
-          $contacts[] = array('name' => $sql_arr['name'], 'email' => format_email_recipient($sql_arr['email'], $sql_arr['name']));
+	while ($sql_arr = $result->iterate()) {
+          foreach ((array)$abook->get_col_values('email', $sql_arr, true) as $email) {
+            $contact = format_email_recipient($email, $sql_arr['name']);
+            $contacts[] = array('name' => $sql_arr['name'], 'email' => format_email_recipient($email, $sql_arr['name']));
+          }
         }
+
         $search = null;
         if($abook->groups) {
           foreach($abook->list_groups($search) as $group) {
@@ -160,7 +163,9 @@
         $abook->set_pagesize(1000);
         $result = $abook->list_records(array('email','name'));
         while ($result && ($sql_arr = $result->iterate())) {
-          $members[] = format_email_recipient($sql_arr['email'], $sql_arr['name']);
+          $email = $abook->get_col_values('email', $sql_arr, true);
+          $email = $email[0];
+          $members[] = format_email_recipient($email, $sql_arr['name']);
         }
       }
     }

Reply via email to