Fix a bug in YetAnotherForum version 1.9.1.8

YetAnotherForumAs my previous post said, I installed Yet Another Forum v1.9.1.8 on my server, then I created a board/forum. In my first and only one forum, I turned on the moderate mode which means that any post topic will not show till the forum administrator approves.

Then I went ahead to create the first new topic, and later on a few replied have been posted. Everything was fine but a few days ago the front page could not be seen. I tried a couple of times, only saw the error messages (There has been a serious error loading the forum. No futher information is available…) as the following screen shot. And funny thing was I still could access to other web pages include the administrative portion.

Error Message

To trouble shoot, I looked at the error log:

Thread information:
Thread ID: 1
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at System.DBNull.System.IConvertible.ToDateTime(IFormatProvider provider)
at System.Convert.ToDateTime(Object value)
at ASP.pages_forum_ascx.__DataBind__control10(Object sender, EventArgs e) in e:\WebDocs\Apps\Forum\pages\forum.ascx:line 76

According to the error log, I checked the asp.net c# source code of page/forum.ascx file and found the LastPosted Date caused this problem. That Last Posted Date was called from the Active Discussion topic section on the front page. I opened the database and found a new topic in the topic table with null value in the LastPosted column. When I added a date time in that column, my forum came back again.

Curiously I went to my forum, and created a new topic in the forum. I got a message said since this is a moderated forum, my post could not be seen till the moderator approves. And after a few, the forum crashed again. I am not sure why this happened, but I doubt there was a bug in the code during moderate mode. If I turn off the moderate, so far, not such crash thing happened.

After looking for solution on YetAnotherForum support forum, I figured out the temporary solution as the below.

  1. Open the file page/forum.ascx, and find the line 76.
  2. Then replace the code on that line with
    <%# FormatDateTimeTopic( Convert.ToDateTime( DataBinder.Eval( Container.DataItem, “LastPosted” ) == DBNull.Value ? DateTime.Now : DataBinder.Eval( Container.DataItem, “LastPosted” ) ) )%>
  3. Save this file, and you will be fine now.

I guess more works need to be done on this version of YAF, 1)  to look up the save topic stored procedure to make sure the last posted date not be null; 2) to modify the forum.ascx file to make sure a pending new topic not shown in the active discussion section.

Tags: , ,

Related posts

0 Responses to “Fix a bug in YetAnotherForum version 1.9.1.8”


  1. No Comments

Leave a Reply