[Tickets #14753] Re: Doubled name at importing a vcf-file or synchronizing with CardDAV

noreply at bugs.horde.org noreply at bugs.horde.org
Mon Jan 1 16:11:01 UTC 2018


BITTE NICHT AUF DIESE NACHRICHT ANTWORTEN. NACHRICHTEN AN DIESE  
E-MAIL-ADRESSE WERDEN NICHT GELESEN.

Ticket-URL: https://bugs.horde.org/ticket/14753
------------------------------------------------------------------------------
  Ticket           | 14753
  Aktualisiert Von | softload at justmail.de
  Zusammenfassung  | Doubled name at importing a vcf-file or synchronizing
                   | with CardDAV
  Warteschlange    | Turba
  Version          | 4.2.21
  Typ              | Bug
  Status           | Unconfirmed
  Priorität        | 3. High
  Milestone        |
  Patch            |
  Zuständige       |
+Neuer Anhang     | Driver new.php
------------------------------------------------------------------------------


softload at justmail.de (2018-01-01 16:11) hat geschrieben:

The Problem is in class Turba_Driver in function toDriverKeys in file  
horde/turba/lib/Driver.php. This function use the settings  
$cfgSources['localsql']['map']['name']['parse'] in  
horde/turba/config/backends.php. The first array is array('fields' =>  
array('firstname', 'middlenames', 'lastname'), 'format' => '%s %s  
%s'). Is there only a lastname in FN-field of the vcf-file, this entry  
is read as firstname. The middlenames isn't set, if nothing else is in  
FN-field. In line 330 of Driver.php it is then checked, that lastname  
already is set, because of the N-field of the vcf-file. Then both  
for-loops are break. But the Problem is in Line 342. The variable  
$tmp_fields isn't empty and now the fault mapping of the FN-field is  
merge to the existing $fields. The correct way would be to clean the  
array $tmp_fields before breaking the loops.

But i think it is not good to break all loops, because there can be  
additional entrys in FN-field, which wouldn't be set of the N-field.  
So the break in line 333 should be only one break.  But then the  
setting of $tmp_fields in line 335 should be before the break, because  
of a break, the counter isn't correct.

The second bug is the array_merge in line 342. If the parsing-Array is  
empty, $tmp_fields isn't set and array_merge return nothing. So  
$fields is erased. There are two solutions. Set $tmp_fields to an  
empty Array additional before the loop or check $tmp_fields if it is  
set. I prefer the last one.

I made all changes in the appended file "Driver new.php"



softload at justmail.de (2018-01-01 16:11) hat hochgeladen: Driver new.php

https://bugs.horde.org/h/services/download/?app=whups&actionID=download_file&file=Driver%20new.php&ticket=14753&fn=%2FDriver%20new.php





More information about the bugs mailing list