From db03c5d799dbe34301b7034018a254ab0f0f32f3 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 30 Aug 2009 15:09:13 -0700 Subject: Don't try to move an item into its own descendant hierarchy. Just leave it out of the move for now. --- modules/organize/controllers/organize.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/organize/controllers/organize.php b/modules/organize/controllers/organize.php index 22f106e9..27299e85 100644 --- a/modules/organize/controllers/organize.php +++ b/modules/organize/controllers/organize.php @@ -46,7 +46,10 @@ class Organize_Controller extends Controller { $album = ORM::factory("item", $album_id); foreach ($this->input->post("source_ids") as $source_id) { - item::move(ORM::factory("item", $source_id), $album); + $source = ORM::factory("item", $source_id); + if (!$album->is_descendant($source)) { + item::move($source, $album); + } } print json_encode( -- cgit v1.2.3