And Who Says Snow Isn’t Helpful?

With the most recent bout of snow, it’s brought a site “enhancement”. I’ve noticed that the comments part of this site have gotten slower and since I can’t control the power of the hosting server, I can help prevent duplicate posts. Of course to do this, I also had to make a change to the core of MT… more on that below, but at least you don’t have to worry about double-clicking into multiple posts.

For some reason MT has a default mode of “view” when working with comments – it checks the Name attribute of the submit buttons to toggle from view to “preview” or “post” modes. Since I have to use JavaScript to change the enabled state of the button, I also have to submit the form from code. Because of this, the “submit” value isn’t being passed into MT so it’s defaulting to view (which I didn’t even know existed in the first place).

Consequently, you’ll find the file that you need to change in /MT-Root/lib/MT/App/Comments.pm – in there you’ll find a line that states:

  $app->{default_mode} = 'view';

Change this ‘view’ value to ‘post’ and you can enable/disable your post button without worry: anything other than preview will post the data as a comment.

And the snow continues to fall out here – not nearly as heavy as they hyped it up to be either – so I’m going to amuze myself some more!


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.