Formatting Problems and Reposts

Sorry for the recent formatting troubles. Since we upgraded to Drupal 4.7, we’ve had a few minor problems getting all the formatting to work as it was before. There were problems with the image filter module that stopped most of the images from showing up (more about that further down, in case it helps anyone), and then we lost a lot of formatting in arguments between different filters.

Unfortunately, Bloglines at least, and maybe some other RSS readers, counts each change as a repost, and has been showing every post as updated every time we’ve hit or fixed one of these problems, so there’s been a lot of reposting going on. Hopefully, this is over now, but thanks to those who’ve put up with it all. We both use Bloglines too, and I subscribe to all of our own fees, so I’m very aware of how irritating it is 😉

Drupal Image Filter / Image Module Problems

Just in case anyone else hits the same problems, I’ll post this here too, to act as GoogleFood. Unless Google sent you here and you’re looking for an answer to image module problems, you probably don’t want to read this…

We use two Drupal modules for displaying images (when we’re not just using Flickr, that is).

  • image.module lets us post the actual image nodes, and handles displaying them at different sizes.
  • image_filter.module lets us insert those different sized images into other posts.

After upgrading, it seemed like some images worked, but most didn’t. In the posts, the image_filter tags weren’t getting converted to html img tags, so it seemed clear that the fault was in image_filter. To cut out a whole lot of troubleshooting, it turned out that the problem was with the Image module, not image_filter. There is an upgrade script that I’d run, but running it didn’t appear to do anything. In the end, I found that if I visited the small sized version of an image, all of the different sizes would then work (after clearing the cache, anyway).

So, I extracted a list of all image type nodes from the SQL database (using phpMyAdmin to select nid from node where type=’image’, or similar), and used a few search and replaces to turn each of those numbers into a line of PHP to read the URL for the small image’s page, using something like “$tmp=file(‘’);” for each line. I wrapped it in PHP tags, added a line to say “Done” at the end, and ran it.

It ran cleanly through, and after clearing the cache, everything was working again.

Well, not quite. A disk in the server actually picked that moment to fail, then there was a routing issue, so around three and a half hours passed with the site down whilst these problems were sorted out by our hosts (thanks, AIT, for getting it all fixed again for us), then I ran the script again and everything worked.

Looking back on it, it might have been easier to troubleshoot the upgrade script, and see it there’s a flaw in that, but failling that, this method worked ok for me.