[Tickets #13268] Re: Kolab_Storage: PHP error on modifying contact picture

noreply at bugs.horde.org noreply at bugs.horde.org
Tue Jul 1 14:46:17 UTC 2014


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/13268
------------------------------------------------------------------------------
  Ticket             | 13268
  Updated By         | Thomas Jarosch <thomas.jarosch at intra2net.com>
  Summary            | Kolab_Storage: PHP error on modifying contact picture
  Queue              | Horde Framework Packages
  Version            | Git master
  Type               | Bug
  State              | Feedback
  Priority           | 1. Low
  Milestone          |
  Patch              |
  Owners             |
+New Attachment     |  
0001-Correctly-remove-old-attachments-from-cache-during-u.patch
------------------------------------------------------------------------------


Thomas Jarosch <thomas.jarosch at intra2net.com> (2014-07-01 14:46) wrote:

Ok, I've added the usual lot of debug statements
and found out what's going on:

The $delete() array contains a list of "IMAP uids" (=backend IDs)
that got deleted - including the corresponding object uid.

When you update a contact in turba, $_data[self::OBJECTS][$object_id]
will contain the *current* datastructure as passed on by the turba  
Kolab driver.

There is no 'id' column in '_attachments' as
the '_attachments' datastructure looks like this:
-------------------------
Array
(
     [photo.jpg] => Array
         (
             [type] => image/jpeg
             [content] => Resource id #331
         )
)
-------------------------


The transformation of that data structure for the on-disc format
of the cache happens a few lines below.

Things are different when you delete a contact,
'_attachments' then looks like this as it's not
updated by the turba Kolab driver itself:
-------------------------------------------------------
[_attachments] => Array
(
     [id] => Array
         (
             [0] => photo.jpg
         )

     [type] => Array
         (
             [image/jpeg] => Array
                 (
                     [0] => photo.jpg
                 )

         )

)
-------------------------------------------------------

Please apply the attached patch to handle both cases.

I've tested the patch with debug statements in place
to verify it does delete the correct attachment
in both the modify and delete case of a contact object.




Thomas Jarosch <thomas.jarosch at intra2net.com> (2014-07-01 14:46)  
uploaded:  
0001-Correctly-remove-old-attachments-from-cache-during-u.patch

http://bugs.horde.org/h/services/download/?app=whups&actionID=download_file&file=0001-Correctly-remove-old-attachments-from-cache-during-u.patch&ticket=13268&fn=%2F0001-Correctly-remove-old-attachments-from-cache-during-u.patch





More information about the bugs mailing list