<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet href="http://bugs.horde.org/themes/feed-rss.xsl" type="text/xsl"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
 <channel>
  <title>Handling of composite fields during import</title>
  <pubDate>Sat, 22 Nov 2008 10:56:10 -0500</pubDate>
  <link>http://bugs.horde.org/ticket/6900</link>
  <atom:link rel="self" type="application/rss+xml" title="Handling of composite fields during import" href="http://bugs.horde.org/ticket/6900/rss" />
  <description>Handling of composite fields during import</description>

  
  
  <item>
   <title>Hello together,

composite fields like &quot;name&quot; are not comp</title>
   <description>Hello together,

composite fields like &quot;name&quot; 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 &quot;similar&quot; code in the $driver-&gt;toHash() fucntion.
Maybe that can be remove if the new code gets in place.

Thomas
</description>
   <pubDate>Wed, 11 Jun 2008 09:40:55 -0400</pubDate>
   <link>http://bugs.horde.org/ticket/6900#t46255</link>
  </item>
  <item>
   <title>This patch causes the individual fields that compose the com</title>
   <description>This patch causes the individual fields that compose the composite field to be overwritten with null values when the composite field is not being saved as a separate field in the backend storage...</description>
   <pubDate>Wed, 11 Jun 2008 11:46:35 -0400</pubDate>
   <link>http://bugs.horde.org/ticket/6900#t46266</link>
  </item>
  <item>
   <title>&gt; This patch causes the individual fields that compose the c</title>
   <description>&gt; This patch causes the individual fields that compose the composite 
&gt; field to be overwritten with null values when the composite field is 
&gt; not being saved as a separate field in the backend storage...

Do you mean this part?

+                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.
</description>
   <pubDate>Wed, 11 Jun 2008 11:59:12 -0400</pubDate>
   <link>http://bugs.horde.org/ticket/6900#t46271</link>
  </item>
  <item>
   <title>
&gt; It sets $hash[$key] which points to the composite field,</title>
   <description>
&gt; It sets $hash[$key] which points to the composite field, not the 
&gt; individual part.


Yes, but follow the code in toDriverKeys() through some more and you'll see that if we are not saving the composite field to storage (in other words, if $this-&gt;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 &quot;out of the box&quot; localsql source using Turba's UI....it nulls out all the individual name fields.

</description>
   <pubDate>Wed, 11 Jun 2008 12:08:22 -0400</pubDate>
   <link>http://bugs.horde.org/ticket/6900#t46273</link>
  </item>
  <item>
   <title>&gt; Yes, but follow the code in toDriverKeys() through some mo</title>
   <description>&gt; Yes, but follow the code in toDriverKeys() through some more and 
&gt; you'll see that if we are not saving the composite field to storage 
&gt; (in other words, if $this-&gt;map[$key]['attribute'] is empty) then the 
&gt; composite field is parsed out into it's individual fields, and then 
&gt; *those* values are saved to the $fields array when the arrays are 
&gt; merged.

Thanks, you are right, I didn't notice that code path before.

Attached is an updated patch to fix this issue. I also updated
the comment to be more precise about it.
</description>
   <pubDate>Wed, 11 Jun 2008 12:42:01 -0400</pubDate>
   <link>http://bugs.horde.org/ticket/6900#t46275</link>
  </item>
  <item>
   <title>Changes have been made in CVS for this ticket:

http://cvs.h</title>
   <description>Changes have been made in CVS for this ticket:

http://cvs.horde.org/diff.php/turba/lib/Driver.php?r1=1.195&amp;r2=1.196&amp;ty=u</description>
   <pubDate>Wed, 11 Jun 2008 13:32:44 -0400</pubDate>
   <link>http://bugs.horde.org/ticket/6900#t46277</link>
  </item>
  <item>
   <title>Changed the order of the conditional checks to put the (expe</title>
   <description>Changed the order of the conditional checks to put the (expensive) 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.</description>
   <pubDate>Wed, 11 Jun 2008 13:35:28 -0400</pubDate>
   <link>http://bugs.horde.org/ticket/6900#t46278</link>
  </item>
  <item>
   <title>Changes have been made in CVS for this ticket:

http://cvs.h</title>
   <description>Changes have been made in CVS for this ticket:

http://cvs.horde.org/diff.php/turba/lib/Driver.php?r1=1.57.2.58&amp;r2=1.57.2.59&amp;ty=u</description>
   <pubDate>Wed, 11 Jun 2008 13:36:50 -0400</pubDate>
   <link>http://bugs.horde.org/ticket/6900#t46279</link>
  </item>
  

 </channel>
</rss>
