Fix bug #8523 - Photo attribute is corrupted after a move or a copy
authorRyu <ryu@ryux.org>
Wed, 30 Sep 2009 19:51:26 +0000 (21:51 +0200)
committerJan Schneider <jan@horde.org>
Thu, 1 Oct 2009 09:50:52 +0000 (11:50 +0200)
Signed-off-by: Jan Schneider <jan@horde.org>
turba/lib/View/Browse.php

index 09d6df5..20cf7e1 100644 (file)
@@ -191,7 +191,10 @@ class Turba_View_Browse {
                     foreach ($targetDriver->getCriteria() as $info_key => $info_val) {
                         if (!is_array($targetDriver->map[$info_key]) ||
                             isset($targetDriver->map[$info_key]['attribute'])) {
-                            $objAttributes[$info_key] = $object->getValue($info_key);
+                            $objectValue = $object->getValue($info_key);
+                            
+                            // get 'data' value if object type is image. Get the direct value in other case.
+                            $objAttributes[$info_key] = ($GLOBALS['attributes'][$info_key]['type'] == 'image') ? $objectValue['load']['data'] : $objectValue;
                         }
                     }
                     unset($objAttributes['__owner']);