Archives » July 31st, 2006

July 31, 2006

Broken Links in MT Comment Notification E-mails

I upgraded to the new Movable Type 3.3 a while ago, and for the most part I like it. There are a few enhancements to the interface, just little incremental things that don’t mean much by themselves but when taken together make a big difference. And there’s a lot that’s stayed the same because it already works well, and doesn’t need to be changed.

But there was one big annoyance that really had me rattled. After I upgraded to MT 3.3, all the comment notification e-mails I would get were text-wrapped at 72 characters. Now I know there’s a debate out there about this, some people that say all outgoing mails should be text-wrapped because some e-mail clients don’t know how to handle free-flowing text and wrap it themselves (those PINE users sure are vocal). And if it was just text I wouldn’t mind it being wrapped for me. But MT was wrapping the links in the text too, the links that you click on to edit or approve a comment. I used those links all the time, because no matter how much filtering gets installed I still get spam comments. With those links it only took about two clicks to delete those nasty buggers. But when MT wrapped the text and inserted a line break in the middle of the link, I couldn’t click on it anymore. This added a few more steps to my mission of wiping out spam, but what made it especially bad was that the links were still there, taunting me, visible but broken.

Luckily today I found the fix. And it’s not an easy fix, like setting something in the configuration panel. You have to dig into the source code for Movable Type and make the change there. Which means when MT 3.4 comes out and you upgrade your files, this fix will be wiped out. We can only hope Six Apart will have fixed this bug by then, but it’s still a messy workaround. Here’s how you do it:

Open your FTP and go into your mtadmin folder, or whatever you named it. Drill down into the /lib/MT/App directory and look for two files, Comments.pm and Trackback.pm. Each of them contains a line that handles the text wrapping that you’ll need to comment out. This is what the line looks like:

$body = wrap_text($body, 72);

You’ll want to open each file and change the line so it looks like this:

# $body = wrap_text($body, 72);

In Trackback.pm, that code appears on Line 420. In Comments.pm, it shows up twice, on Line 198 and Line 614. Comment out all three of those occurrences, then save the files and upload them back to your server. This should fix the text wrap on future e-mails.

I hope Six Apart addresses this in a future release. It’s pretty bad to put a link in an e-mail and then make it so you can’t click on it. Their programmers are usually better than that.

Tip found at http://www.sixapart.com/movabletype/forums/index.php?showtopic=54652 (which isn’t working right now…check out Google’s cached version).

Enable Old Extensions on Firefox 2.0 Beta 1

So you’re running the shiny new beta version of Firefox 2.0. Perhaps on Build 5472 of Vista…who knows? But anyway, you’re running Firefox and you’re peeved because all your favorite extensions don’t work. Web Developer Toolbar, Session Saver, BugMeNot, they’re all listed in the Extensions windows (Or, Add-Ons, as they’re called now), but they’re all disabled. They don’t run on this version, they say. The max version allowed is 1.5.0.x, and they won’t work on 2.0b1. So they sit there, taunting you, and you wonder how you’re going to get out of this one.

Well, now you don’t have to worry any more. I found the secret sauce that lets all your old extensions run in Firefox 2.0. What you do is type about:config in the address bar to get to Firefox’s configuration panel, then right click and choose New > Boolean. For the “preference name” enter extensions.checkCompatibility, and for the value choose false. Click OK, then reboot Firefox and all your extensions should run just fine. Or most of them anyway. There may be some of them that clash with the new stuff in Firefox 2.0, so be prepared to do some troubleshooting or disable them manually. Like I have a favorite theme, Noia Lite, and using it on Firefox 2 screws up the tabs. So I had to turn it off. But most of the extensions should work just fine after applying this fix.

Hat tip to the MozillaZine forums on this one.