add comment hangs

Topics: Controls
Jun 12, 2009 at 3:49 AM

I'm running BE 1.4.5 on my site and adding new comments to blog posts has suddenly stopped working.  I'm wondering if anybody else has seen this behavior before I start debugging.

I'm not getting any JS errors, it's just staying on the saving comment .gif.  From what I can tell, the problem seems to be with the following bit of js:

WebForm_DoCallback('ctl00$becphBody$beCommentView1', argument, callback, 'comment', null, false);

I can't seem to get AppendComment(args, context) to show me anything.  Like it's not even getting called.

URL: http://www.demacmedia.com/post/2009/06/11/Yellow-Pages-Downfall-Seems-Fairly-Apparent.aspx

 

Any help or guidance is greatly appreciated!

 

Coordinator
Jun 12, 2009 at 11:58 AM

When posting a comment, an error appears to be occurring.  The following message comes back from the asynchronous post to the server:

"There was an error in the callback."

In your web.config file, try changing the <customErrors> tag to the following:

<customErrors mode="Off">

After making this change, try posting a comment again.  You might still not see anything, but a different (hopefully more informative) error message will come back from the server.  The default <customErrors> is suppressing the actual error.

You can use Fiddler or Firebug to see the response coming back from the server.

Jun 12, 2009 at 1:41 PM
Edited Jun 12, 2009 at 1:46 PM

Thanks BenAmada.  I was using Fiddler last night and I seem to have missed that error message coming back.

Here is my error message:

The target 'ctl00$becphBody$beCommentView1' for the callback could not be found or did not implement ICallbackEventHandler.

This is quite helpful!  Thanks!!

Edit: I thought maybe it was something weird like the xhtmlConformence, but this is a stand alone app in IIS and even if I specify xhtmlConformance = transitional it doesn't help.  Looking at other possibilities.

Any ideas?  No akismet on this either.

Coordinator
Jun 12, 2009 at 9:42 PM

Have you made any modifications to BE?

Specifically in the CommentView.ascx.cs file in the User controls folder, you should have the following line towards the top of the file:

public partial class User_controls_CommentView : UserControl, ICallbackEventHandler

The important part there is "ICallbackEventHandler".  This control/file needs to implement the ICallbackEventHandler interface.

Jun 15, 2009 at 9:43 AM

Try to debug "AppendComment()" function in blog.js, I had same problem I debugged the js file and got that corrected.

:Ajay

http://www.ajaymatharu.com

Aug 20, 2009 at 12:02 PM

Fix (using BE 1.5, standard (then slightly customised) theme, IIS 7, ASP.NET 3.5):

In blog.js - replace line 71 with:

 WebForm_DoCallback(BlogEngine.comments.controlId, argument, callback, 'comment', null, false);
The problem is the hardcoded identifier.  I think more recent versions of .NET or IIS change the way the control ID is built up.

Hope this helps!

Aug 20, 2009 at 9:24 PM

YYYYEESSSSS this fixed my issue! Thank you SO MUCH!

Coordinator
Aug 21, 2009 at 11:47 AM

Thanks amitch17 & all.  BE 1.5.1.18 now includes that fix to blog.js

Aug 21, 2009 at 11:23 PM

I'm having the identical problem, the saving comment gif animation runs and never stops. In my case, we have had BE1.5 running fine on a dev server, but this problem cropped up when we moved it to production (an internet, not available outside our network.) Also, if I login as Admin I can comment, only anonymous comments fail. I'm using a modified version of the standard theme. When I switched back to the default theme the issue still occurred.

I tried editing blog.js to replace
WebForm_DoCallback('ctl00$cphBody$CommentView1', argument, callback, 'comment', null, false);

with
WebForm_DoCallback(BlogEngine.comments.controlId, argument, callback, 'comment', null, false);

but that did not help.

Checking the response in Firebug, I get this:

eObject reference not set to an instance of an object.128|/wEWDALx+qbTAgLKq+3bAwLV5fejDAK5tPznAwLvqb3IDALciJWGBgLMrpA8Avmh3e8MAveK04cKAtyToqkGAve1mLsFAtya6vIL5+v8x+C1pq6WRL4TRaTZLhsya7I=
Any ideas?

 

Aug 21, 2009 at 11:39 PM
JimReed wrote:
but this problem cropped up when we moved it to production (an internet, not available outside our network.)

Of course I meant  to say "Intranet, not available outside our network."

 

Oct 11, 2009 at 12:01 AM

I'm having the same problem as the last fellow, and in my case at least I noticed the difference is that the bug occurs on IE, but not in Firefox.

Oct 29, 2009 at 2:06 PM

ditto with the IE vs Firefox problem - it's something to do with the url it's calling.

If you look in fiddler, you'll see a 404 for the callback: http://localhost/post/2009/09/21/I-will-blog.aspx%23comment - it seems the # is encoded to %23 and is causing the problem.

If you enter a post by click on the title, then scroll down to add a comment, it works fine.

But if you click the 'comments' link or any other entrypoint that changes the url and appends #comments to the end, then you get the hanging problem (this also affects the preview functinality too).

A real pain, but i'm a little stumped at the mo - any ideas anyone?

 

Nov 4, 2009 at 5:10 PM

I too am seeing this problem but only in Chrome and using Fiddler wasn't any help. I get the spinning glyph but that's it.

I haven't had much chance to debug this any further at this point.

My blog.js has the fix indicated above.

Nov 4, 2009 at 6:07 PM

In my case it's looking like registerCommentBox isn't getting called. I'm seeing the error:

Uncaught TypeError: Cannot read property 'value' of null

And when I inspect BlogEngine.commentBox.<any_control> they're all null.

Unforutnately, that's all the debugging I have time for right now but thought I'd post this in case it helps anyone else.

 

 

 

Nov 4, 2009 at 6:22 PM

I've found and fixed my problem which is I had some other Javascript that was preventing registerCommentBox from getting called. doh!

Dec 11, 2009 at 6:57 PM

I'm having the same issue as goolag2009...

 

When looking at the request with fiddler, I see http://localhost/XXXX/postname.aspx%23comment

 

but when using fiddler and firefox I see http://localhost/xxxx/postname.aspx

 

 

any help?  I've tried the fixes in this post, and another post that add script to the commentview.ascx to convert the form to URI encoded, and that didn't work (well, it did, temporarily, and unreliably)

Coordinator
Dec 11, 2009 at 7:15 PM

jcr159:  What theme are you using?  Does this happen with the Standard theme that ships with BE?

I've seen before where Redirects from server code that include a # sign can get incorrectly encoded as part of the URL (like your example shows).

But quickly looking through the BE code, the only place I see a Redirect occurring with a # sign is after a comment is deleted by the admin.

What sequence of events are you doing to get this problem?  Are you just clicking the 'Comments' link at the bottom of each post on the homepage, for example?

Oct 15, 2010 at 9:23 PM

I have 1.6.1 installed and am getting the "there was an error in the callback" when I hit submit to post a comment as a non-admin.

Has anyone figured this out?

Nov 27, 2010 at 5:02 AM

I'm having the same issue as goolag2009 and jcr159

I am using BlogEngine 1.6. Seems like the issue crops up only for IE on a box with IIS 7

I have in blog.js -  WebForm_DoCallback(BlogEngine.comments.controlId, argument, callback, 'comment', null, false);
The #Comment is definitely causing some issue.

Thanks for any help.

Coordinator
Nov 27, 2010 at 9:02 AM

In blog.js, right above the WebForm_DoCallback, try adding this:

// alert(document.forms[0].action);
document.forms[0].action = location.href.replace(location.hash, "");
// alert(document.forms[0].action);
The 1st and 3rd lines you could uncomment for debugging purposes to see what you get before and after the change made on the 2nd line.

Nov 27, 2010 at 9:57 AM

Thanks a lot BenAmada that solved the issue.

Nov 27, 2010 at 10:00 AM

Thanks Ben, my live version is 1.6.1. also. I think there is another post somewhere in the discussions with a code fix for this?

Coordinator
Nov 27, 2010 at 7:48 PM

It's good that worked.

AnthonyGrace:  I don't remember another Discussion here about this particular problem.  But there's a lot of discussions here !   So might be possible.