From 10e4e2842f7752fa1cd7cb9ee9edc969f629e2b9 Mon Sep 17 00:00:00 2001 From: rWatcher Date: Wed, 20 Jan 2010 19:12:47 -0500 Subject: [PATCH] Fixed issue with batch tagging the contents of sub-albums. --- modules/batchtag/controllers/batchtag.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/batchtag/controllers/batchtag.php b/modules/batchtag/controllers/batchtag.php index db4b081f..9b24b657 100644 --- a/modules/batchtag/controllers/batchtag.php +++ b/modules/batchtag/controllers/batchtag.php @@ -39,15 +39,13 @@ class BatchTag_Controller extends Controller { } else { // Generate an array of all non-album items in the current album // and any sub albums. - $children = ORM::factory("item", $input->post("item_id")) - ->where("type", "!=", "album") - ->descendants(); + $item = ORM::factory("item", $input->post("item_id")); + $children = $item->descendants(); } - // Loop through each item in the album and make sure the user has // access to view and edit it. foreach ($children as $child) { - if (access::can("view", $child) && access::can("edit", $child)) { + if (access::can("view", $child) && access::can("edit", $child) && !$child->is_album()) { // Assuming the user can view/edit the current item, loop // through each tag that was submitted and apply it to