Don't try to move an item into its own descendant hierarchy. Just leave it out of the move for now.

This commit is contained in:
Bharat Mediratta
2009-08-30 15:09:13 -07:00
parent dee0abfab9
commit db03c5d799
+4 -1
View File
@@ -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(