nForum Post Submits hangs until manual reload of browser ?
hi,
Whenever I try to submit a post a comment/quote/edit with content (i.e Not empty) the submission hangs with posting reply in all browsers (FF, chrome, ie7+). I've had a look at the source in ForumEditPost.ascx and put in Response.Redirect(Raw.Url) to refresh the page automatically but with no luck.
Once I manually refresh the page post appears but my client doesn't want this to happen obv.
It only happens with templates that have the macro "nforum edit post" hence ForumEditPost.ascx
I've got this problem too, but in a slightly different fashion. First, I'm using nForum v1.7 for an Umbraco v6.1.6 site. Secondly, the topic was not created in Umbraco's backend. Thirdly and most important, the submission works alright if the logon user did create the topic as well. But if another user submits a reply, the page hangs and he/she needs to refresh it manually to be able to see the new post.
The usercontrol is ForumListPostsInTopic.ascx and the redirect that fails is in nforumgeneral.js. As Paul seem to have found out, this issue has something to do with subscription (if I remove the subscription feature from the forum, the redirect seem to work; however I'd like to offer subscriptions). The Firebug error message is "Internal server error".
I've never used Umbraco 6 so haven't used nForum 1.7, however it sounds to me that the ForumSubscribedToList isn't being filled in? Text Field in forum category/topic stores all the subscribed users ids of that topic. Have you checked there?
The error is caused by some Javascript in nforumgeneral.js. You can overwrite your file with mine and it should fix things up :) I can't remember if I had to implement any extra paragraph or div tags but it should work fine.
Paul, I've checked the "Forum Topic Subscribed List" and it seem to work as expected.
Devin, I'm now using your reworked version of nforumgeneral.js. It did one great thing for me - it got the subscripe/unsubscribe switch to start working properly, which it did not do before. Thank you very much for that :-) However, it did not solve my main problem - i.e. when some other user than the topic creator submits a post, this new post can be seen first after pressing the refresh button. There are, from what I can see, no changes made in the "buttonsubmitpost.click" function of your nforumgeneral.js file compared to the original file. Did you experience this issue? Or was it just about subscription in your case?
Paul, I'm using Firefox and Chrome so far, so I believe that any Internet Explorer issues can be put aside for the moment. I had a look at "Bex's fix" but found out that most of it is already in nforumgeneral.js for version 1.7 (which I'm using).
However, I just saw an interesting thing. If you subscribe for a topic, my issue is gone! If you unsubscribe, it's back! So I think you're right - it's connected to the subscription functionality in some way. But I'm pretty sure it's not a JavaScript issue but a problem on the server side. And this is why:
If a user that did not create the topic tries to submit a post, and he/she has not subscribed to the topic, then the following error is generated:
"NetworkError: 500 Internal Server Error". And it's raised in /base/Solution/NewForumPost/1461.aspx, where 1462 is the node id of the topic.
Apologies Jan - My Javascript post fixes the "subscribe" + "unsubscribe" button (switching between).
I know what breaks the post when you are unsubscribed, but I'm not sure how to fix it.
This piece of code handles subscriptions in the source.
nForum.BusinessLogic -> nForumBaseExtensions.cs (line 292 according to FireBug).
Removing the below code fixes the subscribe/unsubscribe issue but of course that disables the functionality of it working. I think I may have fixed this before but I can't see any changes in my code.
//Send notifications if enabled); if(mainSettings.EnableTopicEmailSubscriptions) { //Get the full list of subscribers var forumTopic = _mapper.MapForumTopic(UmbracoAppHelpers.GetPage((parentTopicId)));
//get the post to use in the emails and the topic var forumPost = _mapper.MapForumPost(UmbracoAppHelpers.GetPage((d.Id)));
// get the subscriber ids just in case we need to remove the current person from it var subscriberIds = forumTopic.SubscriberIds;
// Don't email the member their own posts in the notifications if(loggedInMember.Id== forumPost.Owner.MemberId) { subscriberIds.Remove(loggedInMember.Id); }
Ok so I have fixed this problem and would like to share it with you guys. Not sure if Lee wants to include this fix in a new release, but you'll need the download the source off of codeplex to implement this fix.
All I did was added a check to only run the subscription code (to send out e-mails etc) if there is a subscriber. After that, the page posts succesfully without running into any problems.
Hope this helps.
File - nForumBaseExtension.cs
Find:
//Send notifications if enabled); if (mainSettings.EnableTopicEmailSubscriptions) { //Get the full list of subscribers var forumTopic = _mapper.MapForumTopic(UmbracoAppHelpers.GetPage((parentTopicId)));
//get the post to use in the emails and the topic var forumPost = _mapper.MapForumPost(UmbracoAppHelpers.GetPage((d.Id)));
// get the subscriber ids just in case we need to remove the current person from it var subscriberIds = forumTopic.SubscriberIds;
if (subscriberIds.Count > 0) { //Get email ready var sb = new StringBuilder(); sb.AppendFormat(library.GetDictionaryItem("NewPostIn"), forumTopic.Name); sb.Append(forumPost.Content.ConvertBbCode()); sb.AppendFormat(library.GetDictionaryItem("DirectLink"), HttpContext.Current.Request.UrlReferrer);
// Add emails to array var memberemails = subscriberIds.Select(id => new Member(id)).Select(m => m.Email).ToList();
// Don't email the member their own posts in the notifications if (loggedInMember.Id == forumPost.Owner.MemberId) { subscriberIds.Remove(loggedInMember.Id); }
}
Replace with:
//Send notifications if enabled); if (mainSettings.EnableTopicEmailSubscriptions) { //Get the full list of subscribers var forumTopic = _mapper.MapForumTopic(UmbracoAppHelpers.GetPage((parentTopicId)));
//get the post to use in the emails and the topic var forumPost = _mapper.MapForumPost(UmbracoAppHelpers.GetPage((d.Id)));
// get the subscriber ids just in case we need to remove the current person from it var subscriberIds = forumTopic.SubscriberIds;
// only run this code if there is a subscriber if (subscriberIds != null) // FIX { // Don't email the member their own posts in the notifications if (loggedInMember.Id == forumPost.Owner.MemberId) { subscriberIds.Remove(loggedInMember.Id); }
if (subscriberIds.Count > 0) { //Get email ready var sb = new StringBuilder(); sb.AppendFormat(library.GetDictionaryItem("NewPostIn"), forumTopic.Name); sb.Append(forumPost.Content.ConvertBbCode()); sb.AppendFormat(library.GetDictionaryItem("DirectLink"), HttpContext.Current.Request.UrlReferrer);
// Add emails to array var memberemails = subscriberIds.Select(id => new Member(id)).Select(m => m.Email).ToList();
nForum Post Submits hangs until manual reload of browser ?
hi,
Whenever I try to submit a post a comment/quote/edit with content (i.e Not empty) the submission hangs with posting reply in all browsers (FF, chrome, ie7+). I've had a look at the source in ForumEditPost.ascx and put in Response.Redirect(Raw.Url) to refresh the page automatically but with no luck.
Once I manually refresh the page post appears but my client doesn't want this to happen obv.
It only happens with templates that have the macro "nforum edit post" hence ForumEditPost.ascx
This is in nForum1.5
Has anyone else had this issue?
Paul
This is just an issue if you create a topic in umbraco backend so not a main issue but still would be nice to know
subscription was the key
Hi,
I've got this problem too, but in a slightly different fashion. First, I'm using nForum v1.7 for an Umbraco v6.1.6 site. Secondly, the topic was not created in Umbraco's backend. Thirdly and most important, the submission works alright if the logon user did create the topic as well. But if another user submits a reply, the page hangs and he/she needs to refresh it manually to be able to see the new post.
The usercontrol is ForumListPostsInTopic.ascx and the redirect that fails is in nforumgeneral.js. As Paul seem to have found out, this issue has something to do with subscription (if I remove the subscription feature from the forum, the redirect seem to work; however I'd like to offer subscriptions). The Firebug error message is "Internal server error".
Grateful for any help
/Jan
Hi Jan,
I've never used Umbraco 6 so haven't used nForum 1.7, however it sounds to me that the ForumSubscribedToList isn't being filled in? Text Field in forum category/topic stores all the subscribed users ids of that topic. Have you checked there?
Paul
Hi Guys,
The error is caused by some Javascript in nforumgeneral.js. You can overwrite your file with mine and it should fix things up :) I can't remember if I had to implement any extra paragraph or div tags but it should work fine.
http://pastebin.com/YB8z7RnS
Not sure if Lee wants to implement my fix into 1.7 or a later version.
Thanks,
Devin
Hi Paul and Devin,
Thank you for taking your time to try to help.
Paul, I've checked the "Forum Topic Subscribed List" and it seem to work as expected.
Devin, I'm now using your reworked version of nforumgeneral.js. It did one great thing for me - it got the subscripe/unsubscribe switch to start working properly, which it did not do before. Thank you very much for that :-) However, it did not solve my main problem - i.e. when some other user than the topic creator submits a post, this new post can be seen first after pressing the refresh button. There are, from what I can see, no changes made in the "buttonsubmitpost.click" function of your nforumgeneral.js file compared to the original file. Did you experience this issue? Or was it just about subscription in your case?
/Jan
Hi Jan,
What browser are you using and would this help -
http://our.umbraco.org/projects/website-utilities/nforum/general/33378-IE-issue-rel-tag-missing-Create-TopicPost-issue
click the link to bex fix or alternatetively go to http://our.umbraco.org/projects/website-utilities/nforum/general/29631-Getting-javascript-error-when-in-IE,-when-adding-post-or-topic?p=1
Paul, I'm using Firefox and Chrome so far, so I believe that any Internet Explorer issues can be put aside for the moment. I had a look at "Bex's fix" but found out that most of it is already in nforumgeneral.js for version 1.7 (which I'm using).
However, I just saw an interesting thing. If you subscribe for a topic, my issue is gone! If you unsubscribe, it's back! So I think you're right - it's connected to the subscription functionality in some way. But I'm pretty sure it's not a JavaScript issue but a problem on the server side. And this is why:
If a user that did not create the topic tries to submit a post, and he/she has not subscribed to the topic, then the following error is generated:
"NetworkError: 500 Internal Server Error".
And it's raised in /base/Solution/NewForumPost/1461.aspx, where 1462 is the node id of the topic.
Does that information produce any new ideas?
/Jan
Apologies Jan - My Javascript post fixes the "subscribe" + "unsubscribe" button (switching between).
I know what breaks the post when you are unsubscribed, but I'm not sure how to fix it.
This piece of code handles subscriptions in the source.
nForum.BusinessLogic -> nForumBaseExtensions.cs (line 292 according to FireBug).
Removing the below code fixes the subscribe/unsubscribe issue but of course that disables the functionality of it working. I think I may have fixed this before but I can't see any changes in my code.
Another way to confirm this is to untick the "Forum Enable Topic Email Subscriptions" option for the forum. Posts work fine then.Ok so I have fixed this problem and would like to share it with you guys. Not sure if Lee wants to include this fix in a new release, but you'll need the download the source off of codeplex to implement this fix.
All I did was added a check to only run the subscription code (to send out e-mails etc) if there is a subscriber. After that, the page posts succesfully without running into any problems.
Hope this helps.
File - nForumBaseExtension.cs
Find:
Replace with:
is working on a reply...