Friday, 21. March 2008
In the previous post I explored using the MarsEdit Media Manager to upload non-image files to your website. As a file uploader it works great, but it doesn't work quite as well as a “media manager” for those non-image files. After uploading an MP3 file I went to the Media Manager Catalog to see if I could drop an existing MP3 file into a new blog post as easily as I could with an existing image file. I couldn't because the Media Manager Catalog doesn't handle non-image files well at all.

The highlighted area in the above screenshot is the MP3 file of Memento Mori by The Bastard Fairies that I uploaded earlier. Media Manager displays a light blue rectangle as a place holder for the file but it will not show me the file name or even let me click to select it. I tried uploading several other non-image file types – such as a PDF file – and the Media Manager Catalog handles them all the same way.
The Media Manager Catalog clearly intends to handle non-image files because there is a combo box that can used to filter the view by all files (the default), images only or non-image files only. Interestingly, I can select and insert a non-image file by using the cursor keys to select the file and then clicking insert, but I can't select the file with a mouse click. Even then if there is more than one non-image file there is no way to tell which non-image file you are inserting because there is no file name displayed.
I don't know if this would be classified as a bug or a partially implemented feature. Whatever the case, I would like to see Red Sweater get the Media Manager Catalog working to fully support non-image files. While they are at it there are some other features I would like to see in the Media Manager.
- Catalog Sync –
Sync the Media Manager Catalog with files that already exist on the web server. Add existing files to the catalog and also dDelete any entries from the catalog that don't exist on the web server.
- Catalog Delete – Delete a file from the Media Manager Catalog.
and also delete the file from the web server. It might also be nice to download the deleted file first and put it in the local Trash in case you made a mistake or change your mind.
- QuickLook Integration – While I wouldn't expect anything more than an icon in the Media Manager Catalog for non-image files, it would be nice to be able to preview the files in QuickLook. This would be a nice feature even for image files which already have a thumbnail view in the Media Manager Catalog.
- Upload and Hyperlink Path Config – Configuration option to specify/override the default for both the file upload and hyperlink paths. (I swear this was an option in an earlier version. But I guess either I hallucinated it, I can't find it now or it has disappeared in the current version.)
- Upload Multiple Files – Drop more than one file on the uploader and upload them all to the web server.
- Replace File – When uploading a file with the same name as an existing file, Media Manager adds “_0″, “_1″, etc. to the file name and uploads it as a new file. It would be nice to have the option to replace the existing file instead.
- Catalog Duplicate Files – When a file with the same name is uploaded the blog API adds “_0″, “_1″, etc. to the file name, but the Media Manager Catalog still shows the original name in the Catalog instead of the new name.
If you have any additional suggestions for improving Media Manager let me know in the comments. Better yet, let Red Sweater know too. MarsEdit is a great product but we can help them make it even better.
Update: I opened a topic on this issue on Red Sweater's MarsEdit forum. You can comment there as well as here.
Update: Daniel Jalkut responded to the forum post and pointed out that some of these features are simply not possible given the current blog APIs. I have updated my list accordingly.
Wednesday, 19. March 2008
Reader dimmer asks:
Out of curiosity have you tried uploading an mp3 via MarsEdit? Does it work?
I had not tried it and before the question was asked I had not uploaded any files besides JPEGs with MarsEdit. But why not try now? The MarsEdit Media Manager allows you to upload any type of file to your web server. I looked around for an MP3 that I could offer on my site without running afoul of the dreaded RIAA. I had just downloaded The Bastard Fairies album Memento Mori and since they encourage free distribution of their music* I picked a track, dropped it on the Media Manager and then clicked Upload & Insert.

When the MP3 file finished uploading MarsEdit added a link to the file into the draft of this post:
It look's like you don't have Adobe Flash Player installed. Get it now.
It works great, but with one caveat that I'll talk about in my next post.
*The download page for Memento Mori says:
These 12 tracks from our album are FREE for all to download, and we just ask one simple thing. Please make copies for all your friends and ask them to do the same, and so on and so forth.
Saturday, 9. February 2008
Drupal 6.0 RC4 was released yesterday and I downloaded it and took it for a spin. The good news is that the problems I reported here and here have been fixed.
The bad news is that after installing it and running the update I could not post a new blog entry with MarsEdit 2. When I tried to post a test message I received this error dialog:

The problem is related to the “Blog ID” that is configured in MarsEdit's blog settings and the way Drupal handles that blog ID:

When MarsEdit auto-detects the blog ID it gets a value of “1″. For Drupal 6.0 RC3 and prior the blogapi.module was mapping the blog ID to a content type. A blog ID of “1″ mapped to a content type of “blog”. Starting with RC4 that mapping was removed. RC4 treats the blog ID and the content type as synonomous. This was causing the function _blogapi_validate_blogid to fail because it was trying to validate that the current user had permissions to publish a content type of “1″ but the content type should actually be “blog” instead.
The fix for this is to change the blog ID in MarsEdit to “blog” as shown here:

Changing the blog ID to “blog” allows posting and does not appear to have any negative side affects.
Update: Apparently the change was intentional in Drupal and the issue persists in versions 6.0 and 6.1. All of the functions in blogapi.module that need a blog ID are expecting a blog ID of “blog” now. Daniel Jalkut of Red Sweater Software pointed out the the incorrect blog ID is being returned by Drupal's RSD function. This is causing any blogging software that uses RSD for auto-discovery to get the wrong blog ID which in turn causes the problems described earlier in this post. The blog ID is hardcoded to “1″ in blogapi.modules's RSD function. I submitted a patch to change the blog ID returned by the RSD function in blogapi.module to “blog” so that RSD auto-discovery will work correctly with MarsEdit and hopefully other blogging clients as well. You can also view and download the patch here.
Tuesday, 5. February 2008
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.