6.0.0-alpha10
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
5/15/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#14753] Doubled name at importing a vcf-file or synchronizing with CardDAV
*
Your Email Address
*
Spam protection
Enter the letters below:
.__ . ,.___..__.. . [__) \./ _/ | || | | \ | ./__.|__\|__|
Comment
> 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"
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers