Debugging MT Templates
[Posted to The Changeblog on April 22, 2003 08:57 AM| Links to this post ]
Apologies to anyone that may have been reading out the RSS feed last night - or even to those of you that happened to visit while I was blasting the main page with bogus posts.

MT has been behaving badly since I imported my old Radio posts. Sporadically, the server would return a 500 error when I posted a new article. And of course, there was not pattern to the behaviour. I couldn't figure out why for the longest time - it didn't seem to be a code problem, data integrity seemed to be fine, no fatal flaws in any of the templates - everything seemed to be working A1.

Last night in going through the category archive templates with a fine tooth comb I noticed this:

<MTEntries last="90">
Aha! It should have read:
<MTEntries lastn="90">
"MTEntries" is a container tag representing a list of entries/posts from your blog. "lastn=" is a modifier to MTEntries that simply displays the last n entries to the blog.

In the absence of a properly formatted "lastn=" MT was simply trying to publish archive pages that included all entries for that particularly category. And each time that it got to the "Random Bytes" category, MT choked on trying to create a page that consisted of 100's of entries.

Silly me.

I would love to see better template debugging tools. There really is no way, except trial and error, to find culprits such as this one.

Post a comment