After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 232451 - LDAP backend should use displayName for full_name
LDAP backend should use displayName for full_name
Status: RESOLVED OBSOLETE
Product: evolution
Classification: Applications
Component: Contacts
2.6.x (obsolete)
Other All
: Normal normal
: ---
Assigned To: evolution-addressbook-maintainers
Evolution QA team
evolution[ldap]
Depends on:
Blocks: 327508 327510
 
 
Reported: 2002-10-17 14:41 UTC by Dan Winship
Modified: 2021-05-19 12:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Rough code for a suggested fix (2.25 KB, patch)
2009-07-29 23:20 UTC, jfrank
needs-work Details | Review

Description Dan Winship 2002-10-17 14:41:27 UTC
RFC2798 (inetOrgPerson) says:

   When displaying an entry, especially within a one-line summary list,
   it is useful to be able to identify a name to be used.  Since other
   attribute types such as 'cn' are multivalued, an additional attribute
   type is needed.  Display name is defined for this purpose.

We should be using displayName rather than cn for the full_name attribute.
This will also fix the problems some sites have with using pas-backend-ldap
to talk to Active Directory.

Apparently Netscape and Pine both use displayName rather than cn.
Comment 1 olaf 2003-11-28 15:51:22 UTC
Please, make it configurable.
And please don't do any assumption on content as currently with with 'cn'.
This makes entries with layout other than "surname lastname" to be
useless.
Eg. "surname lastname description" renders in evolution as:
description, surname.
Comment 2 JP Rosevear 2004-01-06 18:04:45 UTC
This is definitely the right thing to do but we are too short of time
for 2.0
Comment 3 olaf 2006-03-24 22:35:42 UTC
In 2.6.0 still not fixed. Any hope to have it in 2.6.x ?
Comment 4 André Klapper 2006-07-11 15:31:05 UTC
removing old target milestone.
Comment 5 Sebastien Bacher 2007-01-26 14:17:02 UTC
Ubuntu bug about that: https://launchpad.net/evolution/+bug/81349
Comment 6 Milan Crha 2008-02-25 14:20:55 UTC
Where/how do you want to configure such thing? For example, my test server has pretty "cn" and no "displayName". And as I saw the code, the "displayName" is mapped to Nick name in the contact.
Comment 7 olaf 2008-02-25 15:05:11 UTC
As you see from above coments:

1. I have also pretty "cn" also :) 
The problem is that Evolution is not displaying them as they are. It takes 1st and 3rd word of "cn" attribute and displays it as 3,1.
If it didn't modify the "cn" attribute value it would be fine for me.

2. Other people pointed out that "cn" is a multivalued attribute. And "displayName" is not.

I suppose you could have a setting "LDAP attribute to use as contact name" configured per LDAP addressbook. And if this setting is not null, then it is used.

Comment 8 Milan Crha 2008-02-25 15:19:27 UTC
I'm afraid that the problem isn't with cn, but with E_CONTACT_FULL_NAME property, it just tries its best to parse it in proper way (here really badly).
Comment 9 Milan Crha 2008-03-04 21:10:27 UTC
I just noticed that you can pick the way how evolution shows your contact when editing it, the dropdown arrow next to File Under field. Does that do what you want from evo? Maybe an option for reasonable default can be better that playing with LDAP backend?
Comment 10 jfrank 2009-07-29 23:18:21 UTC
Pseduocode in diff format for e-book-backend-ldap.  Basically adds a method that fronts the decision whether to get the fullname as displayname, and if that isn't there, gets cn.

This may or may not even compile... sorry that's the best I can do.


335d334                                                                     
<       STRING_PROP (E_CONTACT_FULL_DISPLAY_NAME,   "displayName" ),        
1201a1201                                                                   
>       char *cn, *cn_part = NULL;                                          
1203c1203,1236                                                              
<       dn = contact_get_fullname(contact, root_dn);                        
---                                                                         
>                                                                           
>       cn = e_contact_get (contact, E_CONTACT_FULL_NAME);                  
>       if (cn) {                                                           
>               if (strchr (cn, ',')) {                                     
>                       /* need to escape commas */                         
>                       char *new_cn = g_malloc0 (strlen (cn) * 3 + 1);     
>                       int i, j;                                           
>                                                                           
>                       for (i = 0, j = 0; i < strlen (cn); i ++) {         
>                               if (cn[i] == ',') {                         
>                                       sprintf (new_cn + j, "%%%02X", cn[i]);
>                                       j += 3;                               
>                               }                                             
>                               else {                                        
>                                       new_cn[j++] = cn[i];                  
>                               }                                             
>                       }                                                     
>                       cn_part = g_strdup_printf ("cn=%s", new_cn);          
>                       g_free (new_cn);                                      
>               }                                                             
>               else {                                                        
>                       cn_part = g_strdup_printf ("cn=%s", cn);              
>               }                                                             
>       }                                                                     
>       else {
>               cn_part = g_strdup ("");
>       }
>
>       dn = g_strdup_printf ("%s%s%s", cn_part,
>                             (root_dn && strlen(root_dn)) ? "," : "",
>                             (root_dn && strlen(root_dn)) ? root_dn: "");
>
>       g_free (cn_part);
>
1204a1238
>
2683,2727d2716
< static char *
< contact_get_fullname(EContact *contact, const char *root_dn)
< {
<       char *name, *cn, *cn_part;
<       name = e_contact_get (contact_new, E_CONTACT_FULL_NAME_DISPLAY);
<
<       if(!name){
<               cn = e_contact_get (contact_new, E_CONTACT_FULL_NAME);
<               if (cn) {
<                       if (strchr (cn, ',')) {
<                               /* need to escape commas */
<                               char *new_cn = g_malloc0 (strlen (cn) * 3 + 1);
<                               int i, j;
<
<                               for (i = 0, j = 0; i < strlen (cn); i ++) {
<                                       if (cn[i] == ',') {
<                                               sprintf (new_cn + j, "%%%02X", cn[i]);
<                                               j += 3;
<                                       }
<                                       else {
<                                               new_cn[j++] = cn[i];
<                                       }
<                               }
<                               cn_part = g_strdup_printf ("cn=%s", new_cn);
<                               g_free (new_cn);
<                       }
<                       else {
<                               cn_part = g_strdup_printf ("cn=%s", cn);
<                       }
<               }
<               else {
<                       cn_part = g_strdup ("");
<               }
<
<               name = g_strdup_printf ("%s%s%s", cn_part,
<                                     (root_dn && strlen(root_dn)) ? "," : "",
<                                     (root_dn && strlen(root_dn)) ? root_dn: "");
<
<               g_free (cn_part);
<               g_free (cn);
<
<       }
<       return name;
< }
<
2741,2742c2730,2731
<       list_name1 = contact_get_fullname(contact_new);
<       list_name2 = contact_get_fullname(contact_current);
---
>       list_name1 = e_contact_get (contact_new, E_CONTACT_FULL_NAME);
>       list_name2 = e_contact_get (contact_current, E_CONTACT_FULL_NAME);
Comment 11 jfrank 2009-07-29 23:20:24 UTC
Created attachment 139511 [details] [review]
Rough code for a suggested fix

sorry i didnt see the attach mode until after i pasted the patch as a comment...
Comment 12 André Klapper 2012-06-29 15:19:54 UTC
Comment on attachment 139511 [details] [review]
Rough code for a suggested fix

"git diff" patch is welcome (current file makes it impossible to know which file is patch, plus missing unified format)
Comment 13 André Klapper 2021-05-19 12:14:34 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. 
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/Community/GettingInTouch/BugReportingGuidelines
and create a new bug report ticket at
  https://gitlab.gnome.org/GNOME/evolution/-/issues/

Thank you for your understanding and your help.