In the Channel Categories API documentation it says to expect an array count of seven, [0-6].
http://ellislab.com/expressionengine/user-guide/development/api/api_channel_categories.html
Notice in the screenshot the returned category_tree() array contains a count of 6, [0-5], missing the (int) Category Parent ID index.
My code to generate this error is simple:
$this->EE->load->library('api');
$this->EE->api->instantiate('channel_categories');
$category_tree = $this->EE->api_channel_categories->category_tree($cat_group->row('group_id'));
var_dump($category_tree);exit();Before submitting a bug report, I wanted to confirm it was a bug. As it stands, the entire method isn’t usable unless I have hook into the parent. Anyway around this issues? I looked at the code at directly in the Api_channel_categories.php file and doesn’t seem like a bug exactly, more like it’s just not suppose to be there.
$this->categories[$key] = array($key, $val['1'], $val['2'], $val['3'], $sel, $depth);
//$this->categories[$key] = array('cat_id' => $key, 'cat_name' => $val['1'], 'group_id' => $val['2'], 'group_name' => $val['3'], 'selected' => $sel, 'depth' => $depth);
$this->_category_subtree($key, $cat_array, $depth, $selected);