Skip to content
Snippets Groups Projects
Commit 2caeac91 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #7163 by walkah: blogapi mt.getCategoryList should return an empty...

- Patch #7163 by walkah: blogapi mt.getCategoryList should return an empty array by default.  Reported by Adriaan.
parent 10bdb51c
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -230,8 +230,8 @@ function blogapi_new_media_object($req_params) {
function blogapi_get_category_list($req_params) {
$vocabularies = module_invoke('taxonomy', 'get_vocabularies', 'blog', 'vid');
if ($vocabularies) {
$categories = array();
if ($vocabularies) {
foreach ($vocabularies as $vocabulary) {
$terms = module_invoke('taxonomy', 'get_tree', $vocabulary->vid, 0, -1, 'tid');
foreach ($terms as $term) {
......@@ -244,11 +244,8 @@ function blogapi_get_category_list($req_params) {
'struct');
}
}
return new xmlrpcresp(new xmlrpcval($categories, "array"));
}
else {
return blogapi_error('no categories');
}
return new xmlrpcresp(new xmlrpcval($categories, "array"));
}
function blogapi_get_post_categories($req_params) {
......
......@@ -230,8 +230,8 @@ function blogapi_new_media_object($req_params) {
function blogapi_get_category_list($req_params) {
$vocabularies = module_invoke('taxonomy', 'get_vocabularies', 'blog', 'vid');
if ($vocabularies) {
$categories = array();
if ($vocabularies) {
foreach ($vocabularies as $vocabulary) {
$terms = module_invoke('taxonomy', 'get_tree', $vocabulary->vid, 0, -1, 'tid');
foreach ($terms as $term) {
......@@ -244,11 +244,8 @@ function blogapi_get_category_list($req_params) {
'struct');
}
}
return new xmlrpcresp(new xmlrpcval($categories, "array"));
}
else {
return blogapi_error('no categories');
}
return new xmlrpcresp(new xmlrpcval($categories, "array"));
}
function blogapi_get_post_categories($req_params) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment