Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#29698 closed defect (bug) (invalid)

blogger.getUsersBlogs XML-RPC method returns an empty array

Reported by: tom103's profile tom103 Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.9.2
Component: XML-RPC Keywords:
Focuses: Cc:

Description

Clients like Windows Live Writer use the blogger.getUsersBlogs method to list available blogs; today I tried to configure my blog in WLW, and I got an error saying that no blogs where found (see this question on wordpress.stackexchange.com), even though I know there are several blogs available (it's a multisite install).

So I experimented a bit with the API, and I realized that wp.getUsersBlogs does return the list of blogs, but blogger.getUsersBlogs and metaWeblog.getUsersBlogs just return an empty array. (see attached HTTP traces)

I was able to use WLW to publish on my blog in a previous WordPress version (back in 3.3 I think), so it seems to be a regression; I don't know exactly when it was introduced.

It might be related to the fact that it's a multisite install; there's another ticket mentioning a problem with this setup.

Attachments (2)

wp.getUsersBlogs.txt (1.8 KB) - added by tom103 10 years ago.
blogger.getUsersBlogs.txt (1.0 KB) - added by tom103 10 years ago.

Download all attachments as: .zip

Change History (5)

#1 follow-up: @redsweater
10 years ago

I tested this against a trunk installation of WordPress with multisite enabled, and I don't see the same issue. I would recommend that tom103 check for PHP errors on the server side to see if there are any clues about why this particular WordPress installation is not working as expected. Perhaps it's a peculiarity of the hosting environment or of specific plugins installed?

If others want to test this quickly against a multisite enabled blog a quick way to do so is to take tom103's blogger.getUsersBlogs example xml cargo, edit it to reflect the credentials of a user who owns multiple blogs on the server, and use curl from the command line to post it to the API endpoint URL. For example, the results of my tests doing this against trunk WP:

% curl -i --data @./pd http://blogtesting/wptrunk/xmlrpc.php

HTTP/1.1 200 OK
Date: Thu, 18 Sep 2014 19:40:58 GMT
Server: Apache/2.0.64 (Unix) PHP/5.3.5 DAV/2 mod_ssl/2.0.64 OpenSSL/0.9.7l
X-Powered-By: PHP/5.3.5
Connection: close
Content-Length: 1641
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
  <params>
    <param>
      <value>
      <array><data>
  <value><struct>
  <member><name>isAdmin</name><value><boolean>1</boolean></value></member>
  <member><name>url</name><value><string>http://blogtesting/wptrunk/</string></value></member>
  <member><name>blogid</name><value><string>1</string></value></member>
  <member><name>blogName</name><value><string>WPTrunk</string></value></member>
  <member><name>xmlrpc</name><value><string>https://blogtesting/wptrunk/xmlrpc.php</string></value></member>
</struct></value>
  <value><struct>
  <member><name>isAdmin</name><value><boolean>1</boolean></value></member>
  <member><name>url</name><value><string>http://127.0.0.1/wptrunk/testprivate/</string></value></member>
  <member><name>blogid</name><value><string>2</string></value></member>
  <member><name>blogName</name><value><string>Testing private Site</string></value></member>
  <member><name>xmlrpc</name><value><string>https://127.0.0.1/wptrunk/testprivate/xmlrpc.php</string></value></member>
</struct></value>
  <value><struct>
  <member><name>isAdmin</name><value><boolean>1</boolean></value></member>
  <member><name>url</name><value><string>http://blogtesting/wptrunk/nodaniel/</string></value></member>
  <member><name>blogid</name><value><string>4</string></value></member>
  <member><name>blogName</name><value><string>Test Site</string></value></member>
  <member><name>xmlrpc</name><value><string>https://blogtesting/wptrunk/nodaniel/xmlrpc.php</string></value></member>
</struct></value>
</data></array>
      </value>
    </param>
  </params>
</methodResponse>
Version 1, edited 10 years ago by redsweater (previous) (next) (diff)

#2 in reply to: ↑ 1 @tom103
10 years ago

Replying to redsweater:

I would recommend that tom103 check for PHP errors on the server side to see if there are any clues about why this particular WordPress installation is not working as expected.

Where should I check that? I'm far from being an expert on either WordPress or PHP...

Perhaps it's a peculiarity of the hosting environment or of specific plugins installed?

It's possible, yes. It's a rather unusual setup: IIS server on a mutualized Windows hosting service, with sites mapped to different domains (the urls in the attached file are redacted). I actually have 4 blogs (2 of them used only for tests)

  • Blog 1 is mysite.com, mapped to blog.mysite.net/en
  • Blog 2 is mysite.fr, mapped to blog.mysite.net/fr
  • Blog 3 is blog.mysite.net/
  • Blog 4 is blog.mysite.net/test

I have the following plugins enabled:

  • Analytics Head
  • Bad Behavior
  • Cookies for Comments
  • Fix remote IP (OVH)
  • Multicons
  • OPML Importer
  • SyntaxHighlighter Evolved
  • WordPress Importer
  • WP-Cumulus
  • WP-Mail-SMTP
  • WP Hide Post

And a custom plugin that replaces the REMOTE_ADDR and REMOTE_HOST headers with the content of HTTP_REMOTE_IP, to work around an issue with the hosting provider.

Anyway, is there any reason why blogger.getUsersBlogs doesn't use the same implementation as wp.getUsersBlogs? It seems to me that they should be synonyms...

#3 @nacin
10 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Hi tom103, at this point this looks like it's a support issue. It may be best for you to try the support forums: http://wordpress.org/support/.

For background as to why they are separate methods, see #7130.

Thanks redsweater for helping out, as always.

Note: See TracTickets for help on using tickets.