Commit de93655e authored by Dries's avatar Dries
Browse files

- Patch #10993 by walkah: fixed problem with blogapi's error checking.

parent 1c592921
...@@ -139,8 +139,8 @@ function blogapi_new_post($req_params) { ...@@ -139,8 +139,8 @@ function blogapi_new_post($req_params) {
$node = node_validate($edit); $node = node_validate($edit);
if (form_get_errors()) { if ($errors = form_get_errors()) {
return blogapi_error(); return blogapi_error(implode("\n", $errors));
} }
if (!node_access('create', $node)) { if (!node_access('create', $node)) {
...@@ -199,8 +199,8 @@ function blogapi_edit_post($req_params) { ...@@ -199,8 +199,8 @@ function blogapi_edit_post($req_params) {
$node = node_validate($node); $node = node_validate($node);
if (form_get_errors()) { if ($errors = form_get_errors()) {
return blogapi_error(); return blogapi_error(implode("\n", $errors));
} }
$terms = module_invoke('taxonomy', 'node_get_terms', $node->nid, 'tid'); $terms = module_invoke('taxonomy', 'node_get_terms', $node->nid, 'tid');
...@@ -463,10 +463,6 @@ function blogapi_error($message) { ...@@ -463,10 +463,6 @@ function blogapi_error($message) {
$message = array($message); $message = array($message);
} }
if ($errors = form_get_errors()) {
$message = $message + $errors;
}
$message = implode(' ', $message); $message = implode(' ', $message);
return new xmlrpcresp(0, $xmlrpcusererr + 1, strip_tags($message)); return new xmlrpcresp(0, $xmlrpcusererr + 1, strip_tags($message));
......
...@@ -139,8 +139,8 @@ function blogapi_new_post($req_params) { ...@@ -139,8 +139,8 @@ function blogapi_new_post($req_params) {
$node = node_validate($edit); $node = node_validate($edit);
if (form_get_errors()) { if ($errors = form_get_errors()) {
return blogapi_error(); return blogapi_error(implode("\n", $errors));
} }
if (!node_access('create', $node)) { if (!node_access('create', $node)) {
...@@ -199,8 +199,8 @@ function blogapi_edit_post($req_params) { ...@@ -199,8 +199,8 @@ function blogapi_edit_post($req_params) {
$node = node_validate($node); $node = node_validate($node);
if (form_get_errors()) { if ($errors = form_get_errors()) {
return blogapi_error(); return blogapi_error(implode("\n", $errors));
} }
$terms = module_invoke('taxonomy', 'node_get_terms', $node->nid, 'tid'); $terms = module_invoke('taxonomy', 'node_get_terms', $node->nid, 'tid');
...@@ -463,10 +463,6 @@ function blogapi_error($message) { ...@@ -463,10 +463,6 @@ function blogapi_error($message) {
$message = array($message); $message = array($message);
} }
if ($errors = form_get_errors()) {
$message = $message + $errors;
}
$message = implode(' ', $message); $message = implode(' ', $message);
return new xmlrpcresp(0, $xmlrpcusererr + 1, strip_tags($message)); return new xmlrpcresp(0, $xmlrpcusererr + 1, strip_tags($message));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment