Jump to content


Photo
- - - - -

Live Writer XMLRPC issue *SOLVED!!!* (I think)


  • Please log in to reply
3 replies to this topic

#1 shmokes

shmokes

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts

Posted 24 August 2011 - 12:59 AM

I have been battling with Windows Live Writer for weeks, trying to get it to connect to my blog. Others have been struggling with the same issue and as near as I can tell nobody has found a solution, as you can see from this thread http://www.pagelines.com/forum/discussion/comment/69584#Comment_69584. But I think I fixed it. I'll post my answer there too, but I get the impression that nobody's watching that thread anymore, so I thought I'd post my solution in a new discussion. In short, I was seeing two distinct, but related problem. First, when trying to download my blog's theme to Windows Live Writer, it would fail. Second (this second problem was actually the cause of the first), when I tried to publish a post to the blog Live Writer would return an error message saying that it failed (even though the post WAS actually published). The error was: ************************************************************* "The response to the metaWeblog.newPost method received from the blog server was invalid: Invalid response document returned from XmlRpc server" ************************************************************* I tracked down the Live Writer Log and deleted it, and then immediately tried to publish a post, producing the error message that so many people are getting. This created a new, relatively small log file that helped me locate the cause of the error message. One line in the log appeared to be the problem. It was repeated approx. 30 times: ************************************************************* Warning: strpos() [

Please Login or Register to see this Hidden Content

]: Empty delimiter in /homepages/22/d334612527/htdocs/Sites/BestKidIpadApps/wp-includes/class-wp-xmlrpc-server.php on line 2469
************************************************************* After that line I see four more warnings, but I think they are related to the line above because they reference line 2469 of that same PHP file in them: ************************************************************* Warning: Cannot modify header information - headers already sent by (output started at /homepages/22/d334612527/htdocs/Sites/BestKidIpadApps/wp-includes/class-wp-xmlrpc-server.php:2469) in /homepages/22/d334612527/htdocs/Sites/BestKidIpadApps/wp-includes/class-IXR.php on line 471

************************************************************* So I found class-wp-xmlrpc-server.php and scrolled down to Line 2469, which reads: ************************************************************* if ( strpos( $post_content, $file->guid ) !== false ) ************************************************************* So, I added the following line directly above that one and it seems to have solved my problem entirely, but I hope if I've done something dangerous one of you PHP gurus will let me know. I have practically no idea what I'm doing. ************************************************************* if($file->guid && !($file->guid == NULL)) ************************************************************* I hope this helps others. I have the impression that a lot of people have struggled with this and, very likely, the solution was to just not use Windows Live Writer, which is a shame because it's so much more capable a program than any other offline blog editor. For reference, here's a larger snippet of my final code: ************************************************************* // find any unattached files $attachments = $wpdb->get_results( "SELECT ID, guid FROM {$wpdb->posts} WHERE post_parent = '0' AND post_type = 'attachment'" ); if ( is_array( $attachments ) ) { foreach ( $attachments as $file ) { if($file->guid && !($file->guid == NULL)) if ( strpos( $post_content, $file->guid ) !== false ) $wpdb->update($wpdb->posts, array('post_parent' => $post_ID), array('ID' => $file->ID) ); } *************************************************************

#2 llstovall

llstovall

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 30 September 2011 - 07:52 AM

Thanks! This worked for me :)

#3 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 30 September 2011 - 03:55 PM

Great :)

#4 strmiba

strmiba

    Member

  • Members
  • 29 posts
  • LocationLondon,UK/Gothenburg,SE
  • Framework Version:Always the latest
  • Country: Country Flag

Posted 08 February 2012 - 07:36 AM

This fix do work for the iPad App Blogsy as well.