Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
The current blogapi doesn't allow to post blog entry because It send to blogapi_validate_user wrong parameters, and also blogapi_blogger_title return a wrong contents.
This is a simple fix, but I think it broke metaWeblogAPI.
For any question write to kbytesys(at)tiscali.it
--- drupal-cvs/modules/blogapi.module Wed Dec 10 10:00:08 2003
+++ /var/www/drupal/modules/blogapi.module Fri Dec 19 22:37:11 2003
@@ -73,7 +73,7 @@
function blogapi_new_post($req_params) {
$params = blogapi_convert($req_params);
- $user = blogapi_validate_user($params[1], $params[2]);
+ $user = blogapi_validate_user($params[2], $params[3]);
if (!$user->uid) {
return blogapi_error($user);
}
@@ -84,13 +84,13 @@
$revision = variable_get("node_revision_blog", 0);
// check for bloggerAPI vs. metaWeblogAPI
- if (is_array($params[3])) {
- $title = $params[3]['title'];
- $body = $params[3]['description'];
+ if (is_array($params[4])) {
+ $title = $params[4]['title'];
+ $body = $params[4]['description'];
}
else {
- $title = blogapi_blogger_title($params[3]);
- $body = $params[3];
+ $title = blogapi_blogger_title($params[4]);
+ $body = $params[4];
}
if (!valid_input_data($title, $body)) {
@@ -339,7 +339,7 @@
else {
return message_access();
}
- }
+ }
else {
return t('Wrong username or password.');
}
@@ -352,6 +352,7 @@
}
else {
list($title, $rest) = explode("\n", $contents, 2);
+ $contents = $rest;
}
return $title;
}
Comments
Comment #1
walkah CreditAttribution: walkah commentedpatch submitted to drupal-devel. slightly modified so we don't break metaWeblogAPI trying to fix bloggerAPI. ;)
Comment #2
Kjartan CreditAttribution: Kjartan commentedComment #3
(not verified) CreditAttribution: commented