Summary | Doubled name at importing a vcf-file or synchronizing with CardDAV |
Queue | Turba |
Queue Version | 4.2.21 |
Type | Bug |
State | Feedback |
Priority | 2. Medium |
Owners | |
Requester | softload (at) justmail (dot) de |
Created | 12/15/2017 (2707 days ago) |
Due | |
Updated | 01/22/2018 (2669 days ago) |
Assigned | 01/22/2018 (2669 days ago) |
Resolved | |
Milestone | |
Patch | No |
New Attachment: turba-backends-patch
diff -u old.php new.php
New Attachment: turba-Driver-patch
diff -u old.php new.php
diff -u old.php new.php
changes are much easier to read and don't depend on the release
version.
the reason i tried to explain the changes with the line numbers and
comments in the provided files.
State ⇒ Feedback
Priority ⇒ 2. Medium
changes are much easier to read and don't depend on the release version.
New Attachment: backends new.php
array('fields' => array('lastname'), 'format' => '%s')
I made this change in the appended file "backends new.php"
New Attachment: Driver new.php
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"
State ⇒ Unconfirmed
New Attachment: Horde Testkontakte.vcf
Patch ⇒ No
Milestone ⇒
Queue ⇒ Turba
Summary ⇒ Doubled name at importing a vcf-file or synchronizing with CardDAV
Type ⇒ Bug
Priority ⇒ 3. High
the contact Test2, which has only a last-name, gets the last-name as
additional first-name. So the name is doubled. The reason is the name
in the FN-field of the vcf-file and the parsing at importing. The user
could be patched this by shut-off the parsing. This could be done with
a local-setupfile backends.local.php in /etc/horde/turba. Following
entry has to be in the file:
<?php
$cfgSources['localsql']['map']['name']['parse'] = array('none');
Because of another bug the array must have an entry. Otherwise nothing
can be imported.