Simplenews + Mime Mail + Drupal 6 = Broken Images
I realize this is probably not the best place to ask this one, but the developer of Mime Mail seems to be pretty much inactive, and I figured some other folks in the newspaper industry might have run across this one.
I'm using Simplenews, Drupal 6, and Mime Mail to create a daily newsletter of our top stories. I've created a view called Newsletter and used PHP to call the different blocks I've set up to display the story title, the thumbnail image, and the teaser text.
But when the newsletter actually sends, any image that has a space in the title is broken. Instead of a %20 to define the space, I get a %20%20, which is a double space and breaks the url.
I was just wondering if anyone else here had run across this problem while designing a daily newsletter for their site.
The simplest answer is to tell my editorial team to not upload images with spaces in the name. But of course, it will take all of 10 minutes before that goes out the window and they do it anyway.


I've "fixed" these sorts of
I've "fixed" these sorts of problems at the source by automatically cleaning up the filename of images on upload. Are people uploading files directly to an FTP or are they using a Drupal interface?
To answer your direct question, though, I have no idea. Sounds like a bug in Mime Mail.
We're uploading via the
We're uploading via the imagefield widget in a cck field.
I know this is a Mime Mail bug, it's been reported previously, as far back as two years ago, but it doesn't seem like it's been fixed.
My hope was to clean up filenames on upload, but imagefield doesn't support renaming files to their md5 hash, so I'm not sure how I'd go about that.
I think we patched
I think we patched imagefield (since we needed to add other things like 'caption' anyway), but you may be able to solve all your problems with this module http://drupal.org/project/transliteration It's mostly for fixing foreign characters, but I think it hooks into file uploads and can turn spaces into underscores too.
BRILLIANT!
eli, thank you so much for that link! That is EXACTLY what I need!
I know for fact my editors won't remove spaces from files downloaded from the AP, for example, so sanitizing them at upload was the perfect solution.
You sir, are the man and have just saved me hours of work. I searched all weekend for a module that would do that, and I guess I just never got my search parameters correct, because I never saw that one.