Fix some issues that cropped up with new turba hook code
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 26 Aug 2010 15:53:08 +0000 (09:53 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 26 Aug 2010 15:53:08 +0000 (09:53 -0600)
turba/lib/Object.php

index c54373b..91ef61e 100644 (file)
@@ -93,7 +93,7 @@ class Turba_Object {
         if (isset($this->attributes[$attribute])) {
             try {
                 return Horde::callHook('decode_attribute', array($attribute, $this->attributes[$attribute], $this), 'turba');
-            } catch (Horde_Exception_HookNotSet $e) {}
+            } catch (Horde_Exception_HookNotSet $e) {
             } catch (Turba_Exception $e) {}
         }
 
@@ -126,8 +126,8 @@ class Turba_Object {
     function setValue($attribute, $value)
     {
         try {
-            $value = Horde::callHook('encode_attribute', array($attribute, $value, $this->attributes[$attribute], $this), 'turba');
-        } catch (Horde_Exception_HookNotSet $e) {}
+            $value = Horde::callHook('encode_attribute', array($attribute, $value, isset($this->attributes[$attribute]) ? $this->attributes[$attribute] : null, $this), 'turba');
+        } catch (Horde_Exception_HookNotSet $e) {
         } catch (Turba_Exception $e) {}
 
         if (isset($this->driver->map[$attribute]) &&