diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-08-30 15:09:13 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-08-30 15:09:13 -0700 |
commit | db03c5d799dbe34301b7034018a254ab0f0f32f3 (patch) | |
tree | 3c61f622633d19077da8762da346612e863aa175 | |
parent | dee0abfab9c613855c9145bd189776cc23d92973 (diff) |
Don't try to move an item into its own descendant hierarchy. Just leave it out of the move for now.
-rw-r--r-- | modules/organize/controllers/organize.php | 5 |
1 files changed, 4 insertions, 1 deletions
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( |