Welcome Guest Search | Active Topics | Log In | Register

3 Pages <123>
"There has been a serious error loading the forum"... Options · View
XeE
#16 Posted : Tuesday, December 25, 2007 11:27:26 PM
Rank: Advanced Member



Joined: 12/6/2007
Posts: 57
Location: pakistan
Hi Jaben, i ve found the bug, when you try to create a new topic in moderated forum, it pass Null to the column "LastPosted" in yaf_topic table against that topic, and then throw an error ("Object cannot be cast from DBNull to other types."Wink to the line
<%# FormatDateTimeTopic( Convert.ToDateTime( DataBinder.Eval( Container.DataItem, "LastPosted" ) ) )%> in forum.ascx file.

Kindly advise, i will try to find the solution tomorrow.

Best Regards,
XeE!
Ederon
#17 Posted : Wednesday, December 26, 2007 11:36:34 AM

Rank: YAF Developer



Joined: 1/8/2007
Posts: 1,083
Location: Heart of Europe
FP-fixed:Ederon
When I post FP:Ederon in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting.
XeE
#18 Posted : Wednesday, December 26, 2007 1:35:14 PM
Rank: Advanced Member



Joined: 12/6/2007
Posts: 57
Location: pakistan
Ederon wrote:
FP-Ederon


?? did you find the solution?
Ederon
#19 Posted : Wednesday, December 26, 2007 5:53:06 PM

Rank: YAF Developer



Joined: 1/8/2007
Posts: 1,083
Location: Heart of Europe
See my sig.
When I post FP:Ederon in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting.
XeE
#20 Posted : Wednesday, December 26, 2007 5:56:23 PM
Rank: Advanced Member



Joined: 12/6/2007
Posts: 57
Location: pakistan
Thanks Ed.... As the forums are closed bcoz of this bug, so i would really appreciate if you look into the code bit soon Smile ,

CheerS!!!
Ederon
#21 Posted : Wednesday, December 26, 2007 6:10:32 PM

Rank: YAF Developer



Joined: 1/8/2007
Posts: 1,083
Location: Heart of Europe
What version is it?
When I post FP:Ederon in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting.
XeE
#22 Posted : Wednesday, December 26, 2007 6:46:30 PM
Rank: Advanced Member



Joined: 12/6/2007
Posts: 57
Location: pakistan
1.9.1.6 (NET v2.0)
Ederon
#23 Posted : Wednesday, December 26, 2007 6:54:19 PM

Rank: YAF Developer



Joined: 1/8/2007
Posts: 1,083
Location: Heart of Europe
I don't have that one installed. Try to compare involved code of 1.9.1.6 with 1.9.3. It works well in 1.9.3 afaik. I guess it's stored procedure yaf_topic_save or yaf_message_save.
When I post FP:Ederon in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting.
XeE
#24 Posted : Wednesday, December 26, 2007 7:01:02 PM
Rank: Advanced Member



Joined: 12/6/2007
Posts: 57
Location: pakistan
as the topic is not approved by moderator, so the null is stored in LastPosted column and when it try to convert it to datetime , it gives error at <%# FormatDateTimeTopic( Convert.ToDateTime( DataBinder.Eval( Container.DataItem, "LastPosted" ) ) )%> , as there is null in that column, well thanks anyway. I will try to solve it.

Regards,
XeE
#25 Posted : Friday, December 28, 2007 12:40:07 AM
Rank: Advanced Member



Joined: 12/6/2007
Posts: 57
Location: pakistan
after the hard work of two weeks, customized registration system, integrated members database, customized everything, and after that i am stucked at this problem, can't move forward coz of this, kindly if there is somebody to help me , i would really appreciate.
XeE
#26 Posted : Saturday, December 29, 2007 12:48:22 AM
Rank: Advanced Member



Joined: 12/6/2007
Posts: 57
Location: pakistan
Finally i have removed the bug and yet again i want to thanks Ed... Razz .. i want to share it with other ppls..... this bug is in moderated forums, as when you try to post new topic in moderated forums, it pass Null to Column "LastPosted" in yaf_topic table, now when you click on forum home page, it try to convert that null into datetime format and then generates an error.

Solution:

Open sp yaf_topic_save then replace the sp with the following.
Note: The addition in this stored procedure is LastPosted, if LastPosted is Null,replace it with current date time. I hope it will help you people as well who want to have some moderated forums.

CREATE PROCEDURE [dbo].[yaf_topic_save](
@ForumID INT,
@Subject NVARCHAR(12Cool,
@UserID INT,
@Message NTEXT,
@Priority SMALLINT,
@UserName NVARCHAR(50) = NULL,
@IP NVARCHAR(15),
@PollID INT = NULL,
@Posted DATETIME = NULL,
@LastPosted DATETIME = NULL,
@Flags INT)
AS
BEGIN
DECLARE @TopicID INT
DECLARE @MessageID INT
IF @Posted IS NULL
SET @Posted = Getdate()
IF @LastPosted IS NULL
SET @LastPosted = Getdate()
INSERT INTO yaf_Topic
(ForumID,
Topic,
UserID,
Posted,
Views,
LastPosted,
Priority,
PollID,
UserName,
NumPosts)
VALUES (@ForumID,
@Subject,
@UserID,
@Posted,
0,
@LastPosted,
@Priority,
@PollID,
@UserName,
0)
SET @TopicID = Scope_identity()
EXEC yaf_message_save
@TopicID ,
@UserID ,
@Message ,
@UserName ,
@IP ,
@Posted ,
NULL ,
@Flags ,
@MessageID OUTPUT
SELECT TopicID = @TopicID,
MessageID = @MessageID
END
GO


CheeRS!!!
XeE!
furiousp
#27 Posted : Wednesday, January 16, 2008 12:26:25 PM

Rank: YAF Forumling


Joined: 1/16/2008
Posts: 7
Location: Dublin
Hi I came across the same problem also. The problem for me was line 76 in forum.ascx:

<%# FormatDateTimeTopic( Convert.ToDateTime( DataBinder.Eval( Container.DataItem, "LastPosted" ) ) )%>

I commented this out (using <%-- --%>Wink and everything is fine now. The problem seems come from the fact that "Active discussions" shows posts even if moderation is turned on and the post hasn't been approved.

I have commented out the "Active discussions" table until this is fixed as i don't want people seeing unapproved posts.
furiousp
#28 Posted : Wednesday, January 16, 2008 12:28:08 PM

Rank: YAF Forumling


Joined: 1/16/2008
Posts: 7
Location: Dublin
Oops, sorry, I didn't see these new posts! I only saw the first page!
chriscant
#29 Posted : Friday, January 18, 2008 3:27:46 PM

Rank: YAF Forumling


Joined: 9/19/2006
Posts: 4
Location: Penrith, England, UK
I am still getting the same with YAF 1.9.1.

The problem is in pages/forum.ascx around line 76 displaying "LastPosted". For topics that have not been moderated, the output from Stored Procedure yaf_topic_latest (ie table yaf_Topic) contains rows with LastPosted set to Null. Convert.ToDateTime doesn't want to work with DBNull. You'll have to write code that copes DBNull.

You can get going by deleting all the code within the surrounding < td > < /td >

Chris
louie k
#30 Posted : Tuesday, January 22, 2008 9:38:36 PM

Rank: YAF Forumling


Joined: 1/22/2008
Posts: 4
I am also having this problem-I;m a total noob at this stuff so I could use some step-by step instructions on how to fix this. I also get teh same error when tryign to set ranks. I have version 1.9.1.2 (NET v2.0).
Users browsing this topic
Guest
3 Pages <123>
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFPro Theme Created by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.3 RC2 | YAF © 2003-2008, Yet Another Forum.NET
This page was generated in 0.233 seconds.

SourceForge.net Logo Powered by ASP.NET v2.0 411ASP.NET