Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

clicking "new" does not bring me to the newest comments.

edited June 2007 in Vanilla 1.0 Help
Mark (et al), I have a discussion that has near 300 pages of comments - (300 pages at 50 comments per page) something happend to cause the recordkeeping to get out of wack. On the discussion list page, when you normaly click on "new" it brings you to the most recently added comment from a particular discussion. Now when you click on new it brings me to the top of page 84 and I don't know why. Similar things, i'm told by my users, are happening in other discussions as well. is there some database tweak I can make for all users such that when they click "new" it behaves as expected?

Comments

  • edited June 2007
    Try deleting any comment in the discussion. If Vanilla's internal count of the number of comments is wrong, this will sync it back up. (if the comment doesn't deserve this treatment, you can undelete it, if you have permission and your preference set to view deleted comments.) If that doesn't work, i'll get some queries together to run against your database and we'll see what numbers they give back. What version of Vanilla is installed? Edit: And does Last Comment or Last Active bring you to the proper place, or is it also broken?
  • Wallphone - thx for the response... version is 1.1.2 and yes both Last Comment and Last Active do the same thing
  • interesting...when i add a new comment it DOES increment some form of message counter - because Last Comment, Last Active, and New all move to the next message on each new addition. I'm going to look thru the database to see if i can fine anything odd
  • think i found it - for whatever reason the CountComments in LUM_Discussion was WAY off ~3500 or thereabouts, but the discussion has 14,000+ messages plus 600+ whispers. In looking i believe that CountComment + CountWhispers is supposed to equal the total number of comments in a discussion. I assume that Vanilla gets a message count by counting the messages in a discussion from an SQL Query rather than by using these fields? The total number of viewable pages (299) was accurate and that could not possibly have come from the message accounting in the discussion table. in any event - i editted the CountComments field to be the total number of Comments, less Whispers, and that seems to correct the issue. When I went back to the discussion grid page i had some 11000 new messages waiting - but THAT accounting was self correcting after entering and exiting the discussion.
  • Both of these queries should return the same value:SELECT count(*) FROM LUM_Comment WHERE DiscussionID = x AND Deleted = 0 AND WhisperUserID = 0 SELECT CountComments FROM LUM_Discussion WHERE DiscussionID = x
    where x is the troublesome discussion ID.

    Did you happen to try deleting/undeleting a comment? Vanilla actually uses that first query to update the counts, (but only when deleting/undeleting... when adding new comments it does a '+1' update) so if that isin't working the way it should that could be the source of the bug.
  • i'll run the SQL yes - i tried deleteing and undeleting - it did not work.
  • edited June 2007
    SELECT count(*) FROM LUM_Comment WHERE DiscussionID = x AND Deleted = 0 AND WhisperUserID = 0

    this SQL statement returns 0 (zero)

    However: this one:
    SELECT count(*) FROM LUM_Comment WHERE DiscussionID = x
    Returns 15060

    and this:
    SELECT count(*) FROM LUM_Comment WHERE DiscussionID = x AND Deleted = '0'
    Returns 15059

    and this:
    SELECT count(*) FROM LUM_Comment WHERE DiscussionID = x AND Deleted = '0' AND WhisperUserID = 0
    Returns 3961

    and this
    SELECT CountComment FROM LUM_Discussion WHERE DiscussionID = x
    14348
  • edited June 2007
    the WhisperUserID defaults to NULL - but since my forums were an upgrade from 0.9.x i looks as if 0's were used instead of nulls - so i'm thinking that this is the SQL that gives the count you were looking for...

    SELECT count( * ) FROM `LUM_Comment` WHERE `DiscussionID` = x AND (`WhisperUserID` IS NULL OR `WhisperUserID` = 0 ) AND `Deleted` = '0'

    so now...can anyone tell me if it's safe to set all WhisperUserID's in LUM_Comment to NULL for all WhisperUserID's with a value of zero
  • That should be fine because no users will have an ID of zero. Always safest to take a backup of your table anyway before carrying out major ops like that :)
This discussion has been closed.