You can finally comment again

| Blogs etc. | 1 Comment

After more than a year of struggling and searching around, I have finally found why the comments on my blog were not working any more.

So the good news for all my readers is this: You can finally comment again!

Since the time I upgraded from MT 4.x to 5.x, the following error message started appearing whenever one attempted to submit comments:

Your comment submission failed for the following reasons: Invalid request.

As it turns out the problem was trivial but extremely difficult to pinpoint. Here's how I figured it out.

I loaded an entry page, activated Firebug, entered some text in the comments field, and hit the submit button. In the Firebug console, there was a javascript error, namely the following:

mtCommentOnSubmit is not defined.

This must mean that mt.js wasn't being loaded in that page. Indeed, upon inspecting the source code, this file was not present. At the same time, another anomaly caught my eye, namely that the file utils.js was being loaded twice.

In addition to the standard "JavaScript" template which outputs the mt.js file, I had created my own user-defined template called "JavaScript Utils" which outputs the utils.js file.

So far so good you might think. Well, it turns out that the following template tag, which I have defined in the "Header" template, doesn't always render the same output:

<script type="text/javascript" src="<$mt:Link template="javascript"$>"></script>

For some strange reason it normally renders mt.js, but in the entry page it incorrectly renders utils.js instead. That's why it was appearing twice, once because of <$mt:Link template="javascript"$> and then again because of <$mt:Link template="JavaScript Utils"$>.

The solution is to rename the template="JavaScript Utils" to template="Javascript-Utils" and the problem is solved.

Now I expect many new comments to appear as the droves of my visitors are unleashed to share their many ideas with me.

Try it out yourself and see if it works.

1 Comment

Leave a comment

Random entries

Here are some random entries that you might be interested in:

Recent Assets

  • flitsfoto-B5H3-IoN-b9E4tr9OrFarmWfWrP5pxuN8AgYw45ABAnqqDrmjSqIc-KKoAQ9Bu_k.jpeg
  • flitsfoto-mjuWdZ1wBk6gJbu9rP7Bu6bETxZplWXFUoEJIA_HfMF0i0MQfgF_y5024mEsOBfH.jpeg
  • Kiffin-10th-hole-2017-05-small.jpg
  • Kiffin-10th-hole-2017-05.jpg
  • ember-rails-and-json-api.png
  • screenshot-www.golf.nl-2017-05-04-15-38-01.png
  • putting-mat.png
  • finished-just-in-time.png
  • Tenerife-flight-path.png
  • listen-to-me-marlon.jpg
  • sneeuwval.jpg
  • frozen-crystals.png

Recent Comments

Golf Handicap

Information

This personal weblog was started way back on July 21, 2001 which means that it is 7-21-2001 old.

So far this blog contains no less than 2288 entries and as many as 1877 comments.

Important events

Graduated from Stanford 6-5-1979 ago.

Kiffin Rockwell was shot down and killed 9-23-1916 ago.

Believe it or not but I am 10-11-1957 young.

Began well-balanced and healthy life style 1-8-2013 ago.

My father passed away 10-20-2000 ago.

First met Thea in Balestrand, Norway 6-14-1980 ago.