From e6505d058f5069fbc42eb3b2fb88c3aa551733a5 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Sat, 11 Dec 2010 19:20:01 -0500 Subject: [PATCH] expire the listCache when a share is saved, or parent is changed. --- framework/Share/lib/Horde/Share.php | 10 ++++++++++ framework/Share/lib/Horde/Share/Object.php | 1 + framework/Share/lib/Horde/Share/Object/Sql/Hierarchical.php | 1 + 3 files changed, 12 insertions(+) diff --git a/framework/Share/lib/Horde/Share.php b/framework/Share/lib/Horde/Share.php index d5e349d3d..4f77bf44a 100644 --- a/framework/Share/lib/Horde/Share.php +++ b/framework/Share/lib/Horde/Share.php @@ -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. * diff --git a/framework/Share/lib/Horde/Share/Object.php b/framework/Share/lib/Horde/Share/Object.php index 055b7d917..66e03d2a9 100644 --- a/framework/Share/lib/Horde/Share/Object.php +++ b/framework/Share/lib/Horde/Share/Object.php @@ -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(); } diff --git a/framework/Share/lib/Horde/Share/Object/Sql/Hierarchical.php b/framework/Share/lib/Horde/Share/Object/Sql/Hierarchical.php index ef5d74a80..8e2c1257d 100644 --- a/framework/Share/lib/Horde/Share/Object/Sql/Hierarchical.php +++ b/framework/Share/lib/Horde/Share/Object/Sql/Hierarchical.php @@ -131,6 +131,7 @@ class Horde_Share_Object_Sql_Hierarchical extends Horde_Share_Object_Sql $child->setParent($this); } + $this->_shareOb->expireListCache(); return true; } -- 2.11.0