diff --git a/resources/inc/class.resources_bo.inc.php b/resources/inc/class.resources_bo.inc.php index b4c2335363..ada2c166b1 100755 --- a/resources/inc/class.resources_bo.inc.php +++ b/resources/inc/class.resources_bo.inc.php @@ -546,8 +546,17 @@ class resources_bo if($cat && stripos($cat, $search) !== FALSE) { // Get resources for that category - $resources = $bo->get_resources_by_category($cat_id); - + if(!$options['exec']) + { + $resources = $bo->get_resources_by_category($cat_id); + } + else + { + $cat_options = $options; + $cat_options['cat_id'] = $cat_id; + $resources = $bo->link_query('',$cat_options); + } + // Edit dialog sends exec as an option, don't add categories if(count($resources) && !$options['exec']) { @@ -707,6 +716,10 @@ class resources_bo if($options['start'] || $options['num_rows']) { $limit = array($options['start'], $options['num_rows']); } + if($options['cat_id'] && in_array($options['cat_id'], $filter['cat_id'])) + { + $filter['cat_id'] = $options['cat_id']; + } if($options['accessory_of']) { $filter['accessory_of'] = $options['accessory_of'];