Fixing two annoying issues in Movable Type

After playing around with the Movable Type Motion Beta (I’ve got a copy of it running somewhere), I spent the better part of an afternoon trying to figure out if the problems with updating external app streams (such as Twitter updates) were related to some kind of configuration problem or related to the beta-state of Motion. After realizing that the run-periodic-tasks script for my permanent blog does nothing for installed betas, or other instances of Movable Type (me stupid), I realized that MT still hasn’t corrected some easy errors in their modules. Nor have I. The problem is fixed now, and I’m writing down two simple fixes to two hard-to-research problems.
Problem 1: Can’t locate MT/Bootstrap.pm in @INC
So, say you’re getting a constant error in your daily cron logs when trying to do background publishing in Movable Type. You know, you’re trying to run the run-periodic-tasks script to take care of background tasks by setting up a cron job, either daily, or six times an hour. Assuming your crontab syntax doesn’t suck ass, now you’re getting messages that look like this:
Can’t locate MT/Bootstrap.pm in @INC (@INC contains: …
This website has some good examples on how to fix this (hint: you don’t have to modify @INC, you can simply modify your run-periodic-tasks file).
Getting background publishing to work in MT 4.1 — GoBecky.net

The problem is that ‘..lib’;. It’s simply pointing to the wrong place in the MT file structure, which is weird, given that it’s their app and all, but whatev. So what you need to do is point the script to Bootstrap.pm using the absolute filepath, and all will be well.

Problem 2: Subroutine MT::Template::Context::post_process_handler and Subroutine MT::Template::Context::add_global_filter
After upgrading your v2.x of Movable Type to v3.x or even v4, you may see these messages in your daily cron logs, if you’re running the run-periodic-tasks script to enable background publishing and housekeeping:
Subroutine MT::Template::Context::post_process_handler redefined at /usr/local/www/cgi-bin/mt/extlib/bradchoate/postproc.pm line 41.
Subroutine MT::Template::Context::add_global_filter redefined at /usr/local/www/cgi-bin/mt/extlib/bradchoate/postproc.pm line 22.
Took me a while to sort this out, but only because I enabed run-periodic-tasks for two fresh installations of v4, and there were no errors in the logs. As discussed here, the problem is that the postproc.pm isn’t used in v3 or v4 of Movable Type. To fix these very noisy messages in your crontab logs, go into /usr/local/www/cgi-bin/mt/plugins and edit the processtags.pl file, replacing:
use bradchoate::postproc;
with something like this:
if (MT->VERSION =~ m/^2.2/) { require bradchoate::postproc; }
or even just comment out the line altogether. You’ll notice all your post processing still works, and you’ll get no more error messages.

5 Responses to “Fixing two annoying issues in Movable Type

  • Just delete the ProcessTags plugin. And postproc.pm while you’re at it. There’s a core mteval attribute for doing that now.

  • …which you’d have been pointed at if the comment form didn’t apparently strip HTML? Just search the docs for it, then, I guess.

  • Thanks for the link. For everyone else’s reference, the link goes to:
    http://www.movabletype.org/documentation/appendices/modifiers/mteval.html
    … which doesn’t really add anything, or even help if you are simply searching for the error message, or any of the following search strings:
    postproc
    ProcessTags
    post_process_handler
    add_global_filter
    bradchoate
    This page isn’t helpful unless you know what the postproc.pm file is trying to do. After getting inside it, or doing some googling, you are likely to figure out it has something to do with processing tags, as most of the complaints/problems with it stem from interactions of this module with other plugins, such as with MTGoogleMaps. Other than that, there’s not anything on that page to indicate that it addresses the problems with postproc.pm.

  • You’re correct that page isn’t findable in any obvious way for the errors having to do with postproc.pm. I made no claim it would would turn up while Googling, I’m just telling you about the filter because I know what the problem you describe is, and it’s due to obsolescence.
    As far as “not helpful,” well, I disagree with you, considering the mteval attribute completely obviates the need for the ProcessTags plugin, which is the *entire reason* you even have postproc.pm at all.
    You seem to be under the impression that postproc.pm is part of MT. It is not. Extract the MT archive on your local computer and check. The documentation has no particular responsibility to this issue, though I’ll tack it on as a comment if it makes you feel better. It’s just an unfortunate leftover of certain then-convenient and now less-recommended practices(putting plugin’s required libraries in extlib) that have since changed. Problems like this sneaking in over time is a good part of the reason for that. While your edit to the postproc file fixes the /symptoms/ by doing a version check, it’s a code hack that most people are simply not going to want to do, and doesn’t address the actual problem, which is that the errors are coming up because it conflicts with code that MT already contains itself: it simply shouldn’t be there at all.

  • Not to get into too much of an argument here, but:
    a) I’m not disagreeing with you on this. I said, quite plainly, the problem is that postproc.pm isn’t used in v3 or v4, so you shouldn’t be using it. I should also get rid of processtags.pl? Sure thing.
    b) I still maintain that the page, by itself, with no mention of deleting the plugin and module, isn’t helpful at all, if you start where I started — at the error messages. It’s not a troubleshooting page, it’s not a page which references any of the errors or files in this discussion, it’s just a description of the mteval modifier.
    Now, that note you recently added to that page, and to the Process Tags page is very, very useful. Thanks so much for adding that in.
    So the proper solution here is to remove both of these files:
    mt/plugins/processtags.pl
    mt/extlib/bradchoate/postproc.pm