Javascript error on saving comment with no preview

May 21, 2009 at 4:55 PM

I was receiving a null reference javascript exception when saving a comment and preview not enabled in version 1.5.  No errors are thrown when preview is enabled.  To fix this I changed the composeComment function on line 43 in blog.js to this:

composeComment: function() {
if (this.$('preview') != null) this.$('preview').className = '';
if (this.$('compose') != null) this.$('compose').className = 'selected';
if (this.$('commentPreview') != null) this.$('commentPreview').style.display = 'none';
if (this.$('commentCompose') != null) this.$('commentCompose').style.display = 'block';
}

Seemed to fix the problem but not sure if this has any other impact though

 

Jul 31, 2009 at 6:21 PM

I have version 1.5.0.7 and received the same error message when I disabled the Preview tab in the settings. I used your fix in the blog.js file and it's working now. Thanks :)

My two cents on the preview is that it looked the same as the comments tab, and I didn't see a use for it. (Plus, there's a loading image that I couldn't get rid of when the user clicked the preview tab.)