diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-07-17 08:14:08 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-07-17 08:14:08 -0700 |
commit | 8a6556b30bc34d69284df6246f4010a8835f3bc2 (patch) | |
tree | 7d0b5374bba65973c2231083bc5d93ad31f4ccfc /modules/gallery/models | |
parent | 0f766b149d0cee7af664f2321fddc6f04cda70ac (diff) |
Fix a bug where moved items don't properly inherit permissions from
their new target. After each move, recalculate the permissions for
the new parent's hierarchy.
Fixes ticket #552
Diffstat (limited to 'modules/gallery/models')
-rw-r--r-- | modules/gallery/models/item.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index 94e2fcf7..6512e9e5 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -122,8 +122,8 @@ class Item_Model extends ORM_MPTT { /** * Move this item to the specified target. * @chainable - * @param Item_Model $target Target item (must be an album - * @return ORM_MTPP + * @param Item_Model $target Target item (must be an album) + * @return ORM_MPTT */ function move_to($target) { if (!$target->is_album()) { @@ -137,6 +137,7 @@ class Item_Model extends ORM_MPTT { $original_path = $this->file_path(); $original_resize_path = $this->resize_path(); $original_thumb_path = $this->thumb_path(); + $original_parent = $this->parent(); parent::move_to($target, true); $this->relative_path_cache = null; @@ -154,6 +155,7 @@ class Item_Model extends ORM_MPTT { @rename($original_thumb_path, $this->thumb_path()); } + module::event("item_moved", $this, $original_parent); return $this; } |