expire the listCache when a share is saved, or parent is changed.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sun, 12 Dec 2010 00:20:01 +0000 (19:20 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sun, 12 Dec 2010 00:20:01 +0000 (19:20 -0500)
framework/Share/lib/Horde/Share.php
framework/Share/lib/Horde/Share/Object.php
framework/Share/lib/Horde/Share/Object/Sql/Hierarchical.php

index d5e349d..4f77bf4 100644 (file)
@@ -540,6 +540,16 @@ class Horde_Share
     }
 
     /**
+     * Expire the current list cache. This would be needed anytime a share is
+     * either added, deleted, had a change in owner, parent, or perms.
+     *
+     */
+    public function expireListCache()
+    {
+        $this->_listcache = array();
+    }
+
+    /**
      * Utility function to be used with uasort() for sorting arrays of
      * Horde_Share objects.
      *
index 055b7d9..66e03d2 100644 (file)
@@ -110,6 +110,7 @@ abstract class Horde_Share_Object implements Serializable
     public function save()
     {
         $this->getShareOb()->runCallback('modify', array($this));
+        $this->getShareOb()->expireListCache();
         return $this->_save();
     }
 
index ef5d74a..8e2c125 100644 (file)
@@ -131,6 +131,7 @@ class Horde_Share_Object_Sql_Hierarchical extends Horde_Share_Object_Sql
             $child->setParent($this);
         }
 
+        $this->_shareOb->expireListCache();
         return true;
     }