From 5d36da80623fac58d302674f64c5b8bf2a7d049d Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 27 Jan 2015 22:43:17 +0000 Subject: [PATCH] Check to make sure found resource is an array instead of a column flag. Fixes fatal error when deleting a category. --- resources/inc/class.resources_hooks.inc.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/resources/inc/class.resources_hooks.inc.php b/resources/inc/class.resources_hooks.inc.php index ebce431b03..3035d6240c 100644 --- a/resources/inc/class.resources_hooks.inc.php +++ b/resources/inc/class.resources_hooks.inc.php @@ -152,10 +152,14 @@ class resources_hooks $query = array('filter' => $args['cat_id']); $bo = new resources_bo(); $bo->get_rows($query, $resources, $readonly); + foreach($resources as $resource) { - $resource['cat_id'] = $new_cat_id; - $bo->save($resource); + if(is_array($resource)) + { + $resource['cat_id'] = $new_cat_id; + $bo->save($resource); + } } }