Forums

[resolved] Bug: WP 2.7 RC2. XMLRPC - getCategories (4 posts)

  1. UseShots
    Member
    Posted 11 months ago #

    Found a bug introduced in RC2.

    XMLRPC function "metaWeblog.getCategories" wouldn't work if any of the categories doesn't have a description. Error " -2: Key [description] not found" is returned.

    If I assign descriptions to all categories the function work. If I remove even one category's description, the function returns error.

    Very nasty bug since the default "Uncategorized" category usually doesn't have any description.

    This bug will prevent offline blog clients from being able to load categories from server (this function is used almost every time to synchronize a client with the server)

    Here is the change in the code:
    xmlrpc.php: function mw_getCategories($args)
    -------
    was (RC1):
    $struct['parentId'] = $cat->parent;
    $struct['description'] = $cat->name;
    -------
    now (RC2):
    $struct['parentId'] = $cat->parent;
    $struct['description'] = $cat->description;
    -------
    No check whether $cat->description exists.

  2. UseShots
    Member
    Posted 11 months ago #

    The same in the final release 2.7

  3. josephscott
    Member
    Posted 11 months ago #

    I have not be able to reproduce this error. Are you using a specific client that is having a problem?

    Testing against 2.7 I make a call metaWeblog.getCategories call and get the default "Uncategorized" category back just fine:

    {
            categoryId = 1;
            categoryName = Uncategorized;
            description = "";
            htmlUrl = "http://localhost/~joseph/wp/trunk/?cat=1";
            parentId = 0;
            rssUrl = "http://localhost/~joseph/wp/trunk?feed=rss2&cat=1";
    }
  4. UseShots
    Member
    Posted 11 months ago #

    Checked with another XMLRPC client and it worked. Must be a bug in the client.

    My appologies for the false alert. I should have tested the issue more thoroughly.

    Thanks

Reply

You must log in to post.

About this Topic