Ecto and Wordpress 2.1: error on getting post categories

by Earl Moore on January 25, 2007

in Observations, Software

If you’re using Ecto to create and edit posts, there is an error in the “xmlrpc.php” file on WordPress 2.1 that causes Ecto to hang up when refreshing. Ecto will hang at the point of collecting post categories.¬† This error is a prior issue that did not get merged into WP 2.1.

The correct code for the get post categories function in xmlrpc.php is notated below. Please add the (string) parameter that is marked in red text to correct this error. You may also review the issue ticket at WordPress support for more information.

WordPress 2.1 xmlrpc.php file source:


function mt_getPostCategories($args) {

$this->escape($args);

$post_ID    = $args[0];
$user_login  = $args[1];
$user_pass  = $args[2];

if (!$this->login_pass_ok($user_login, $user_pass)) {
return $this->error;
}

$categories = array();
$catids = wp_get_post_categories(intval($post_ID));
// first listed category will be the primary category
$isPrimary = true;
foreach($catids as $catid) {
$categories[] = array(
‘categoryName’ => get_cat_name($catid),
‘categoryId’ => (string) $catid,
‘isPrimary’ => $isPrimary
);
$isPrimary = false;
}

return $categories;
}

Technorati Tags: , , ,

{ 2 trackbacks }

Blogula Rasa - Reality-based in spite of my best efforts » ecto ahora es simpatico con Wordpress 2.1
January 27, 2007 at 3:56 pm
WordPress 2.1.2 now available for download : Meandering Passage
March 2, 2007 at 2:16 pm

{ 2 comments… read them below or add one }

1 Walter Hutchens January 27, 2007 at 5:45 pm

A big help! Thanks!

2 Trev March 6, 2007 at 7:02 am

Thanks for this just edited xmlrpc file, ecto working great now!

Leave a Comment