Summary | Handling of composite fields during import |
Queue | Turba |
Queue Version | HEAD |
Type | Bug |
State | Resolved |
Priority | 1. Low |
Owners | mrubinsk (at) horde (dot) org |
Requester | thomas.jarosch (at) intra2net (dot) com |
Created | 06/11/2008 (6230 days ago) |
Due | |
Updated | 06/11/2008 (6230 days ago) |
Assigned | 06/11/2008 (6230 days ago) |
Resolved | 06/11/2008 (6230 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
http://cvs.horde.org/diff.php/turba/lib/Driver.php?r1=1.57.2.58&r2=1.57.2.59&ty=u
State ⇒ Resolved
array_key_exists() call at the end....and committed, thanks!
I left the similar code in toHash() since I'm not sure off the top of
my head if any other code paths would be affected.
http://cvs.horde.org/diff.php/turba/lib/Driver.php?r1=1.195&r2=1.196&ty=u
New Attachment: turba-fix-composite-field-import-v2.patch
you'll see that if we are not saving the composite field to storage
(in other words, if $this->map[$key]['attribute'] is empty) then the
composite field is parsed out into it's individual fields, and then
*those* values are saved to the $fields array when the arrays are
merged.
Attached is an updated patch to fix this issue. I also updated
the comment to be more precise about it.
individual part.
you'll see that if we are not saving the composite field to storage
(in other words, if $this->map[$key]['attribute'] is empty) then the
composite field is parsed out into it's individual fields, and then
*those* values are saved to the $fields array when the arrays are
merged.
To test this, just try to add a new contact in the "out of the box"
localsql source using Turba's UI....it nulls out all the individual
name fields.
field to be overwritten with null values when the composite field is
not being saved as a separate field in the backend storage...
+ if (isset($hash[$mapfields])) {
+ // Add composite field
+ $hash[$key] = null;
+ break;
+ }
It sets $hash[$key] which points to the composite field, not the
individual part.
State ⇒ Feedback
field to be overwritten with null values when the composite field is
not being saved as a separate field in the backend storage...
State ⇒ Assigned
Patch ⇒ No
State ⇒ Unconfirmed
New Attachment: turba-fix-composite-field-import.patch
Milestone ⇒
Queue ⇒ Turba
Summary ⇒ Handling of composite fields during import
Type ⇒ Bug
Priority ⇒ 1. Low
composite fields like "name" are not computed properly f.e. during import.
Attached patch adds support for that. Note: It is intended
to use array_key_exists() in the code.
I've seen there is "similar" code in the $driver->toHash() fucntion.
Maybe that can be remove if the new code gets in place.
Thomas