[Tickets #5609] Different results in vcard export of all vs selected contacts

bugs at bugs.horde.org bugs at bugs.horde.org
Mon Aug 6 21:56:45 UTC 2007


Ticket URL: http://bugs.horde.org/ticket/?id=5609
 Ticket             | 5609
 Created By         | jonrober at stanford.edu
 Summary            | Different results in vcard export of all vs selected contacts
 Queue              | Turba
 Version            | 2.1.4
 Type               | Bug
 State              | Unconfirmed
 Priority           | 1. Low
 Owners             | 

jonrober at stanford.edu (2007-08-06 14:56) wrote:

When exporting an address book to vcard, the N field changes based on
whether or not the user has requested to export all entries.  When the user
only asks to export certain entries, the N field contains the complete
split name (N:Doe;John;;;) but when exporting all entries, the N field
contains only the last name (N:Doe;;;;).

Examining the code, what's happening is that searching for all users calls
the search function in lib/Drive.php, which has as a default to sort by
lastname.  The data coming in (from a Turba MySQL backend) has no lastname
field, so when &search calls the sort function, a lastname is created but
no firstname.  On the other hand, searching for only certain users goes
through different functions, so lastname isn't added onto the records. 
When the vcard function gets the data, it uses the lastname/firstname
values for N if set, or splits the name out entirely from the full name if
not.  Thus, searching for certain users has the vcard function split their
names, while searching for all users returns a number of records with
lastname set but not firstname set, which causes a wrong view of the full

Could you perhaps have sorting fully split the name if it does have to
create a name, rather than only splitting out what it requires for the sort

More information about the bugs mailing list