#1488375 closed Bug Patches (fixed)

addressbook search filters duplicate names

Reported by: dfwarden Owned by:
Priority: 7 Milestone: 0.7.2
Component: Addressbook Version: git-master
Severity: normal Keywords: addressbook, search, duplicate
Cc:

Description

In r5865 of trunk a search of an LDAP address book containing 2 people with the same name will only display one of the entries. When composing a message and using the "live search" feature, both entries are displayed.

This seems to come from program/steps/addressbook/search.inc, specifically line 185 where $key is initialized:

        while ($row = $result->next()) {
            $row['sourceid'] = $s['id'];
            $key = $row['name'] . ':' . $row['sourceid'];
            $records[$key] = $row;
        }

The name and the source addressbook are the only things used to create indexes. Multiple names from the same source will thus be filtered.

I will attach a patch that also includes

$row['email']

in $key. As long as list_records always includes email along with name in its results then this should be a safe change, and I believe list_records does behave this way. This patch will allow multiple entries with the same name to be displayed when searching an address book from the actual address book page.

Attachments (1)

roundcube-addressbook-allowduplicatenames.patch (454 bytes) - added by dfwarden 16 months ago.
Patch program/steps/addressbook/search.inc to allow duplicate names in addressbook search

Download all attachments as: .zip

Change History (2)

Changed 16 months ago by dfwarden

Patch program/steps/addressbook/search.inc to allow duplicate names in addressbook search

comment:1 Changed 16 months ago by alec

  • Milestone changed from later to 0.7.2
  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [0203f163] (tunk) and r5967/svn (0.7).

Note: See TracTickets for help on using tickets.