The MU forums have moved to WordPress.org

wp.getusersblogs does not exist. I always get error message blogs not found. (49 posts)

  1. lunabyte
    Member
    Posted 11 years ago #

    "I don't suppose you have a copy of Windows Live Writer you can test against your WPMU site, do you?"

    Um, no. All Apple, all the time.

    Yeah, 1.5.1. I'm aware of that. I didn't extensively test it, but it did pull down a list of cats and posts.

    Maybe I'm just lucky or something with it, I dunno. I don't use it, but at least was nice enough to check it. Guess I'll just let you folks grumble about it on your own.

  2. jasonkuter
    Member
    Posted 11 years ago #

    @wehican

    'wp.getUsersBlogs' => 'this:blogger_getUsersBlogs',

    Good idea! I can force it to work by changing the user_pass_ok function to just return true in wp-includes/user.php. This is very similar to an error that occurred a while back. It doesn't make any sense that it works for some writers and not others.

    What even weirder is that after I make my first post I can add the wp_authenticate code back and it works fine. I tested this with Flock which is the only writer I have that I know doesn't work in 1.5.1 but did in 1.3.3.

  3. josephscott
    Member
    Posted 11 years ago #

    The expected behavior of blogger.getUsersBlogs is different from wp.getUsersBlogs. I've pinged my contacts on the Windows Live Writer team to about WLW using wp.getUsersBlogs. We'll get this sorted out and come up with a patch/fix.

  4. gcaleval
    Member
    Posted 11 years ago #

    I am running a fresh install of WPMU with two blogs. Scribefire returns the same problem for me as described -- i.e. claiming bad login. My conundrum is that Scribefire works fine to post to my wordpress.com blog and it works fine to post to standalone wordpress blogs.

    I am not skilled in understanding php and could not even find a relevant log so I'm of no help there.

    Question: what version of WPMU is wordpress.com running and is that version available for download and testing?

    I'm trying to make a site for seniors and need to marry it to Scribefire so they never have to worry about the backend. Just click, type, post. But I don't want to have to set up standalones for all of them as it would be a nightmare for me to do the maintainence of the backend for them.

    -- and apologies if this is a dupe of a similar post I made in the Plugins forum -- I hadn't found this thread yet.

  5. lunabyte
    Member
    Posted 11 years ago #

    "Question: what version of WPMU is wordpress.com running and is that version available for download and testing?"

    In a nut shell, they take the same MU that's available to you, and make their own edits to suit their needs. Essentially, they're a user just like anyone else and make edits/fixes on their own time to fit what they are needing to do.

  6. davidprentice
    Member
    Posted 11 years ago #

    Google docs also requires the wp.getUserBlogs for any API selected. It seems to me that adding this method into xmlrpc.php would fix a mess of issues with external posting.

    Thanks to whoever gets this working.

  7. andrea_r
    Moderator
    Posted 11 years ago #

    There's a trac ticket submitted already, but if anyone has anything to add, that'd probably help.

  8. glitchnyc
    Member
    Posted 11 years ago #

    I can report this error in multiple clients, including ecto on mac.

    The following workaround (mentioned above) works in ecto, but not in all other clients. It's also probably a really really bad idea for anything resembling a production environment.

    Add this to xmlrpc.php at line 92:
    'wp.getUsersBlogs' => 'this:blogger_getUsersBlogs',

    Comment out lines 72-73 in wp-includes/user.php
    (in effect, just returning true for user_pass_ok)

  9. glitchnyc
    Member
    Posted 11 years ago #

    Whoo! After one final google I stumbled upon a .diff for xmlrpc.php that adds the missing wp.getusersblogs function:

    http://trac.mu.wordpress.org/attachment/ticket/551/xmlrpc.php.diff

    I reverted my user.php and xmlrpc.php files and then added the lines in that .diff to the stock xmlrpc.php and it works!

    My updated xmlrpc.php file is here as a .zip:
    http://glitchnyc.com/xmlrpc.wp_getusersblogs_fix.zip

  10. stodan
    Member
    Posted 11 years ago #

    That is very good glitchnyc you have cracked the code!! I downloaded your modded version of the xmlrpc and it worked on my remote software package as well. Was working on somthing like that too, but couldn't get it to work without it timeing out. Once again good job :)

  11. andrea_r
    Moderator
    Posted 11 years ago #

    Can you add that the the trac ticket?

  12. wehican
    Member
    Posted 11 years ago #

    glitchnyc, you are a hero. I tried it on my base and a couple of user blogs and it works. It even seems to resolve the stylesheet issue.

    I just put in the blog URL's and it did the rest. I am using subdirectories.

    Cool.

  13. glitchnyc
    Member
    Posted 11 years ago #

    I've added it to the trac ticket as well, giving due credit to the original patcher josephscott. I just took his patch for bug 511 and applied it to the current xmlrpc.php to make this work.

    http://trac.mu.wordpress.org/ticket/631

  14. wehican
    Member
    Posted 11 years ago #

    I will try adding that to my WP 2.5.1 installs. Live Writer would come back saying it couldn't download the stylesheet on those or wordpress.com. This patch seems to maybe have fixed that, though there may be some issues with some themes.

    Thanks for your perserverance and posting the fix.

  15. gcaleval
    Member
    Posted 11 years ago #

    I overwrote my existing xmlrpc.php with the one provided glitchynyc above.

    It completely solved the problem.

    Do I need to be concerned about other issues that overwriting the installed file may cause down the road? I.e. does this particular file have potential to create other incompatabilities?

    Thank you VERY much to gltchynyc for tracking down a solution and to all others without whose help many like me would be lost!

  16. phungnguyen
    Member
    Posted 11 years ago #

    I've been struggling with this problem myself for the past several days!
    Thanks all of you who've worked hard on this issue.

    PN

  17. kxmccallum
    Member
    Posted 11 years ago #

    glitchnyc - u b da man! GREAT WORK!

  18. iamthesuperman
    Member
    Posted 11 years ago #

    just read on all these replies and got this issue resolved. Thanks for all of you. And record the solution on
    http://lichao.net/eblog/fix-the-publish-wpgetusersblogs-error-in-windows-live-writer-after-upgrading-to-wordpress-mu-151-200805146.html
    as well just for your future reference.

  19. beerfan
    Member
    Posted 11 years ago #

    I recommend against using glitchnyc's suggestion because disabling authentication is obviously a concern. I resolved the authentication issue by creating a wp_getUsersBlogs function which accepts the correct args.

    Here's a patch. Hopefully this works.


    --- xmlrpc.php.original 2008-06-09 13:07:19.000000000 -0400
    +++ xmlrpc.php 2008-06-09 13:04:48.000000000 -0400
    @@ -89,6 +89,7 @@
    'wp.getCommentCount' => 'this:wp_getCommentCount',
    'wp.getPostStatusList' => 'this:wp_getPostStatusList',
    'wp.getPageStatusList' => 'this:wp_getPageStatusList',
    + 'wp.getUsersBlogs' => 'this:wp_getUsersBlogs',

    // Blogger API
    'blogger.getUsersBlogs' => 'this:blogger_getUsersBlogs',
    @@ -744,6 +745,44 @@
    return get_page_statuses( );
    }

    + function wp_getUsersBlogs( $args ) {
    +
    + $this->escape( $args );
    +
    + $username = $args[0];
    + $password = $args[1];
    +
    + if (!$this->login_pass_ok($username, $password)) {
    + return new IXR_Error( 403, __( 'Bad login/pass combination.' ) );
    + }
    +
    + do_action('xmlrpc_call', 'wp.getUsersBlogs');
    +
    + $user = set_current_user(0, $username);
    +
    + $blogs = (array) get_blogs_of_user($user->ID);
    +
    + $struct = array();
    +
    + foreach ( $blogs as $blog ) {
    + $blog_id = $blog->userblog_id;
    +
    + switch_to_blog($blog_id);
    +
    + $is_admin = current_user_can('level_8');
    +
    + $struct[] = array(
    + 'isAdmin' => $is_admin,
    + 'url' => get_option('home') . '/',
    + 'blogid' => $blog_id,
    + 'blogName' => get_option('blogname')
    + );
    +
    + restore_current_blog();
    + }
    +
    + return $struct;
    + }

    /* Blogger API functions
    * specs on http://plant.blogger.com/api and http://groups.yahoo.com/group/bloggerDev/

About this Topic