A tale of woe on dynamically building the Movable Type Individual Entry Archive template


March 05, 2005

I've been playing around with Movable Type dynamic rendering templates. Currently I'm using Movable Type 3.15, installed via the standard upgrade path.

This is how it has worked so far:

After performing these steps, I browse to a permalink for one of my entries and am greeted with the following under the Comments section of the page:


Fatal error: Call to undefined function: translate() in
.../mt/php/lib/function.MTCommentFields.php on line 23

:( :(

After doing some investigation, it seems that as of MT 3.15 the <MTCommentFields> template tag is broken out of the box for use with templates that are being dynamically rendered.

Unfortunately it doesn't look to be an easy fix.

I tried doing the following:

Around line 23 of <mt_home>/php/lib/function.MTCommentFields.php we see:


$allow_comment_html_note = (($blog['blog_allow_comment_html'])
  ? $ctx->mt->translate("(You may use HTML tags for style)") : "");

I replace the call to

$ctx->mt->translate(...)
with
$ctx->mt->translate_templatized(...)
(not sure if this is strictly correct, just guessing after looking at the methods contained in <mt_home>/php/mt.php).

So afterward this line looks like:


$allow_comment_html_note = (($blog['blog_allow_comment_html'])
  ? $ctx->mt->translate_templatized("(You may use HTML tags for style)") : "");


Now after navigating to an individual entry permalink I see:


The requested page could not be found.
No comment available

Under the Comments section.

:( :(

This new error seems to be unrelated to the previous change. Now the offending line of code seems to be:


$comment_author = encode_html($ctx->tag('CommentAuthor')) || "";

Around line 49 of the same file (function.MTCommentFields.php).

I can see that the error is being caused in the function smarty_function_MTCommentAuthor in <mt_home>/php/lib function.MTCommentAuthor.php.

I'm not sure how much deeper the problems go, but unless I'm missing something it doesn't look like Six Apart fully tested dynamically building the individual archive template.

Unfortunately, I don't have time to keep looking at this now and trying to find a way to submit bug reports through Six Apart's website only results in useless clickflailing about.

UPDATE:

Apparently the way to report bugs to Six Apart is through the Bugs and Odd Behavior section of the Movable Type Community Forum. I stumbled across this by pure happenstance as it is not indicated anywhere else on Six Apart's site.

At any rate, I have created the following topic:

Problems dynamically building individual archive