#211067 by webchick: blogapi_mt_get_post_categories() not using taxonomy_node_get_terms() properly

6.x
Gábor Hojtsy 2008-01-18 19:03:15 +00:00
parent 1f9f8d9c86
commit 0516192b54
1 changed files with 3 additions and 1 deletions

View File

@ -421,7 +421,8 @@ function blogapi_mt_get_post_categories($postid, $username, $password) {
return blogapi_error($user);
}
$terms = module_invoke('taxonomy', 'node_get_terms', $postid, 'tid');
$node = node_load($postid);
$terms = module_invoke('taxonomy', 'node_get_terms', $node, 'tid');
$categories = array();
foreach ($terms as $term) {
$term_name = $term->name;
@ -430,6 +431,7 @@ function blogapi_mt_get_post_categories($postid, $username, $password) {
}
$categories[] = array('categoryName' => $term_name, 'categoryId' => $term->tid, 'isPrimary' => TRUE);
}
return $categories;
}