Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForumForumCan not post after upgrading to 5.0.0Can not post after upgrading to 5.0.0
Previous
 
Next
New Post
12/8/2010 7:24 PM
 
I have checked all my stored procedures and they all seem correct to the upgrade scripts. The reason for the ALTER was I used the Modify function in SQL Studio to paste the procedure into this forum. This always creates the script with ALTER.

I am still having the problem though.

I think I might have tracked it down to the Addressed column in the table Forum_Posts not accepting null. If you look at the stored procedue Forum_Post_Add it does not insert any value into the column Addressed so wil create a null value which is not allowed. Would someone be able to tell me whether the procedure is wrong or the Addressed column should accept null.

CREATE PROCEDURE {databaseOwner}[{objectQualifier}Forum_Post_Add]
    @ParentPostID INT,
    @ForumID INT,
    @UserID INT,
    @RemoteAddr NVARCHAR(100),
    @Subject NVARCHAR(255),
    @Body NVARCHAR(MAX),
    @IsPinned BIT,
    @PinnedDate DATETIME,
    @IsClosed BIT,
    @PortalID INT,
    @PollID INT,
    @IsModerated BIT,
    @ParseInfo INT
AS
    DECLARE @PostID INT
    DECLARE @ThreadID INT
    DECLARE @CreatedDate DATETIME
    DECLARE @ModeratedForum BIT
    DECLARE @GroupID INT
    DECLARE @DateApproved DATETIME
    DECLARE @IsApproved BIT

    SELECT  @CreatedDate = GETDATE()
    
    IF @IsModerated = 0
        BEGIN
            SET @IsApproved = 1
            SET @DateApproved = GETDATE()
        END
    ELSE
        BEGIN
            SET @IsApproved = 0
        END
        
    IF @ParentPostID = 0 -- New Thread
        BEGIN     
            INSERT  {databaseOwner}{objectQualifier}Forum_Posts
                    (
                      ParentPostID,
                      UserID,
                      RemoteAddr,
                      [Subject],
                      Body,
                      CreatedDate,
                      UpdatedDate,
                      IsApproved,
                      IsClosed,
                      DateApproved,
                      ParseInfo,
                      PostReported
                    )
            VALUES  (
                      @ParentPostID,
                      @UserID,
                      @RemoteAddr,
                      @Subject,
                      @Body,
                      @CreatedDate,
                      @CreatedDate,
                      @IsApproved,
                      @IsClosed,
                      @DateApproved,
                      @ParseInfo,
                      0
                    )
            SET @PostID = SCOPE_IDENTITY()
            SET @ThreadID = @PostID
            
            EXEC {databaseOwner}{objectQualifier}Forum_Thread_Add @ThreadID, @ForumID, @IsPinned,
                @PinnedDate, @PollID

            UPDATE  {databaseOwner}{objectQualifier}Forum_Posts
            SET     ThreadID = @ThreadID
            WHERE   PostID = @PostID       
            
            EXEC {databaseOwner}{objectQualifier}Forum_UserThreadsAdd @UserID, @ThreadID, @CreatedDate   
        END
    ELSE -- Reply
        BEGIN
        
            SET @ThreadID = ( SELECT    ThreadID
                              FROM      {databaseOwner}{objectQualifier}Forum_Posts
                              WHERE     PostID = @ParentPostID
                            )
            INSERT  {databaseOwner}{objectQualifier}Forum_Posts
                    (
                      ParentPostID,
                      UserID,
                      RemoteAddr,
                      [Subject],
                      Body,
                      CreatedDate,
                      ThreadID,
                      UpdatedDate,
                      IsApproved,
                      IsClosed,
                      DateApproved,
                      ParseInfo,
                      PostReported
                    )
            VALUES  (
                      @ParentPostID,
                      @UserID,
                      @RemoteAddr,
                      @Subject,
                      @Body,
                      @CreatedDate,
                      @ThreadID,
                      @CreatedDate,
                      @IsApproved,
                      @IsClosed,
                      @DateApproved,
                      @ParseInfo,
                      0
                    )
            SELECT  @PostID = @@IDENTITY
            
            IF @IsModerated = 0
                BEGIN       
                    EXEC {databaseOwner}{objectQualifier}Forum_AA_ThreadUpdate @ThreadID, @PostID,
                        @IsPinned, @PinnedDate, 'postadd', @PollID
                END   
        END   

    IF @IsModerated = 0
        BEGIN
            EXEC {databaseOwner}{objectQualifier}Forum_AA_UserPostCountUpdate @UserID, @PortalID
            EXEC {databaseOwner}{objectQualifier}Forum_Forum_PostAdded @ForumID, @ThreadID, @PostID,
                @UserID, 'add'
        END
    ELSE
        BEGIN
            EXEC {databaseOwner}{objectQualifier}Forum_Forum_PostAdded @ForumID, @ThreadID, @PostID,
                @UserID, 'submit'
        END
    SELECT  @PostID
GO
 
New Post
12/8/2010 7:54 PM
 
The following SQL has fixed my problem. Not sure why but for whatever reason the default constraints for the Addressed and ParseInfo columns where missing. All appears to be working again now, I fear though that there should be more constraints on the Forum_Posts table than just these 2. Not looking forward to trapsing through the upgrade scripts to find them.

ALTER TABLE {databaseOwner}[{objectQualifier}Forum_Posts]
    ADD CONSTRAINT [DF_{objectQualifier}Forum_Posts_Addressed] DEFAULT (0)
FOR [Addressed]
GO

ALTER TABLE {databaseOwner}[{objectQualifier}Forum_Posts]
        ADD
    CONSTRAINT [DF_{objectQualifier}Forum_Posts_ParseInfo] DEFAULT (0)
FOR [ParseInfo]
GO
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForumForumCan not post after upgrading to 5.0.0Can not post after upgrading to 5.0.0


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out