Drupal 6.0 RC2 and MarsEdit 2

Monday, 21. January 2008

Drupal 6.0 RC2 and MarsEdit 2 don't appear to play nice together. When creating a new post with MarsEdit and posting it using Drupal's XML-RPC interface the post displays fine in Drupal. But Drupal automatically splits the post into two parts – a teaser and the body. When MarsEdit retrieves the post from Drupal it does not get the teaser portion, only the body. When the post is viewed or edited in MarsEdit after publishing it the part of the post that Drupal turned into the teaser is missing. Disabling teasers by setting Drupal's teaser size to unlimited doesn't help either because that makes the entire post the teaser and all MarsEdit has left after posting is the title.

A request for help on the MarsEdit forum generated a rapid reply from Daniel Jalkut of Red Sweater Software. With Daniel's assistance and MarsEdit's handy Network Log (^?N) feature I was able to determine that the problem was with Drupal. Kudos to Daniel for a great product and great support.

The Network Log info gave me a starting place to poke around in the Drupal code. I found some of the problems in Drupal's Blog API module. It turned out that the Blog API module wasn't returning any of the teaser data for the metaWeblog.getPost method and with a simple tweak I was able to make it semi-functional. If you want or need to hack yours up until the Drupal team fixes it:

  • Open modules/blogapi/blogapi.module in your favorite editor.
  • Search for “function _blogapi_get_post“.
  • Change these two lines:
      $xmlrpcval['content'] = "<title>$node->title</title>$node->body";
      $xmlrpcval['description'] = $node->body;

    to this line:
      $xmlrpcval['description'] = $node->teaser . $node->body;

This is only a bandaid and it doesn't fix all the problems. It only works well with teasers disabled for now. And then Drupal doesn't display the teaser part of the post on the permalink page. But those are problems for another day and another post.

Update: A better explanation of the problem and a cleaner fix here.

Share 'Drupal 6.0 RC2 and MarsEdit 2' on Delicious Share 'Drupal 6.0 RC2 and MarsEdit 2' on Facebook Share 'Drupal 6.0 RC2 and MarsEdit 2' on Google Buzz Share 'Drupal 6.0 RC2 and MarsEdit 2' on Google Reader Share 'Drupal 6.0 RC2 and MarsEdit 2' on LinkedIn Share 'Drupal 6.0 RC2 and MarsEdit 2' on Email