Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

issue with deleting comments

edited January 2011 in Vanilla 2.0 - 2.8
I have a couple threads where I deleted the last comment in the thread (just to test things and explore the software). On three occasions when the last comment was deleted, the database entry for the discussion didn't update with the information from the next remaining comment.

Specifically, DateLastComment and LastCommentUserID were set to Null.

The net effect of this was that thread itself would drop to the very bottom of the discussion list, regardless of the DateInserted of the LastCommentID in the comments table.

I went into the database and manually edited the individual discussion tables by inputing appropriate values in the DateLastComment and LaskCommentUserID fields. This restored the threads to their correct place in the forum.

What is it about deleting a comment that caused the error in the first place?

Comments

  • Indeed that really is the case. The problem is caused by the sql to retrieve the 2nd to last posts data which is then inserted as the last post onto the discussion.
    To fix it go to
    \applications\vanilla\models\class.commentmodel.php line 720.

    Replace
    ->Select('c.CommentID')
    with
    ->Select('c.CommentID, c.InsertUserID, c.DateInserted')
  • @mark @tim - I just found that this didn't get fixed in the latest release. Had to reimplement this fix. Not sure if this is a bug or not, just something to think about
  • TimTim Operations Vanilla Staff
    Fixed in unstable. Thanks.

    Vanilla Forums COO [GitHub, Twitter, About.me]

Sign In or Register to comment.