Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Paul Fowles 75 posts 184 karma points
    Jun 17, 2013 @ 16:43
    Paul Fowles
    0

    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

  • Paul Fowles 75 posts 184 karma points
    Jun 17, 2013 @ 17:02
    Paul Fowles
    0

    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

  • Paul Fowles 75 posts 184 karma points
    Jun 18, 2013 @ 18:23
    Paul Fowles
    100

    subscription was the key

  • Jan Bengtsson 64 posts 108 karma points
    Jan 31, 2014 @ 11:40
    Jan Bengtsson
    0

    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  

  • Paul Fowles 75 posts 184 karma points
    Jan 31, 2014 @ 16:47
    Paul Fowles
    0

    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 

  • Devin 87 posts 251 karma points
    Feb 03, 2014 @ 10:51
    Devin
    0

    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

  • Jan Bengtsson 64 posts 108 karma points
    Feb 03, 2014 @ 15:29
    Jan Bengtsson
    0

    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     

  • Paul Fowles 75 posts 184 karma points
    Feb 03, 2014 @ 17:52
  • Paul Fowles 75 posts 184 karma points
    Feb 03, 2014 @ 17:55
  • Jan Bengtsson 64 posts 108 karma points
    Feb 04, 2014 @ 10:47
    Jan Bengtsson
    0

    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 

  • Devin 87 posts 251 karma points
    Feb 06, 2014 @ 14:35
    Devin
    0

    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);
                           
    }

                           
    if(subscriberIds.Count>0)
                           
    {
                               
    //Get email ready
                               
    var sb =newStringBuilder();
                                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 =>newMember(id)).Select(m => m.Email).ToList();
                               
                               
    // Send emails
                               
    Helpers.SendMail(mainSettings.EmailNotification,
                                                 memberemails
    ,
                                                 
    string.Concat(mainSettings.Name, library.GetDictionaryItem("TopicNotificationEmailSubject")),
                                                 sb
    .ToString());                        
                           
    }

                       
    }
    Another way to confirm this is to untick the "Forum Enable Topic Email Subscriptions" option for the forum. Posts work fine then.
  • Devin 87 posts 251 karma points
    Feb 28, 2014 @ 13:32
    Devin
    0

    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();

                                // Send emails
                                Helpers.SendMail(mainSettings.EmailNotification,
                                                 memberemails,
                                                 string.Concat(mainSettings.Name, library.GetDictionaryItem("TopicNotificationEmailSubject")),
                                                 sb.ToString());
                            }

                            // 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();

    // Send emails
    Helpers.SendMail(mainSettings.EmailNotification,
    memberemails,
    string.Concat(mainSettings.Name, library.GetDictionaryItem("TopicNotificationEmailSubject")),
    sb.ToString());
    }
    }

    }
Please Sign in or register to post replies

Write your reply to:

Draft