Kamyar
  • Posts: 321
  • Joined: 22/07/2009
When trying to create a new forum, the db returns the following error:
The INSERT statement conflicted with the FOREIGN KEY SAME TABLE constraint "FK_yaf_Forum_yaf_Forum". The conflict occurred in database "yafnet", table "dbo.yaf_Forum", column 'ForumID'.
Cannot insert the value NULL into column 'ForumID', table 'yafnet.dbo.yaf_ForumAccess'; column does not allow nulls. INSERT fails.
The statement has been terminated.
The statement has been terminated.

That's because the @ParentID is set to 0 which conflicts with the foreign key defined in yaf_forum.
Adding
if @ParentID = 0 set @ParentID = null
to the yaf_forum_save stored procedure solves the issue.
If at first you don’t succeed, call it version 1.0
Sponsor
Kamyar
  • Posts: 321
  • Joined: 22/07/2009
Just committed to SVN No. 3433
Hopefully, it works fine now.
If at first you don’t succeed, call it version 1.0
Users browsing this topic
    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.

    About Us

    The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

    Powered by Resharper Donate with PayPal button

    Project Twitter Updates

    Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved