Just came across this bug. When the category_delete hook is in use, and someone deletes an empty category group, you get a “$cat_ids is not defined” error. Here’s the code in category_model.php to fix it, starting from line #357:
// moved from inside the if-statement
$cat_ids = array();
if ($query->num_rows() > 0)
{
// move this line up
//$cat_ids = array();
foreach ($query->result() as $row)
{
$cat_ids[] = $row->cat_id;
}
$this->db->where_in('cat_id', $cat_ids);
$this->db->delete('category_posts');
}
// -------------------------------------------
// 'category_delete' hook.
//
if (ee()->extensions->active_hook('category_delete') === TRUE)
{
ee()->extensions->call('category_delete', $cat_ids);
}
//
// -------------------------------------------
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.