Please upgrade here. These earlier versions are no longer being updated and have security issues.

Post count not updating.

Hello, I am currently having a problem where on my site the Discussion Count does not update in the category after posting. Is there any way to fix this?

vincitydaimo
«13

Comments

  • I'm having the same problem.

  • Could you try visiting yourforum/dba/counts to see if that fixes your problem?

  • /dba/counts will recalculate

    It can be that there is a denormalise config setting so that counts are updated every post but every n posts, it can also be a problem with caching.

    2.5 is very new, so worth opening an issue on github

    grep is your friend.

    despecial
  • I have the same problem after updating to 2.5.1.
    running /dba/counts resets the counters but they still won't update on their own.

    Recalculate Conversation.CountMessages
    Recalculate Conversation.CountParticipants
    Recalculate Conversation.FirstMessageID
    Recalculate Conversation.LastMessageID
    Recalculate Conversation.DateUpdated
    Recalculate Conversation.UpdateUserID
    Recalculate Discussion.CountComments
    Recalculate Discussion.FirstCommentID
    Recalculate Discussion.LastCommentID
    Recalculate Discussion.DateLastComment
    Recalculate Discussion.LastCommentUserID
    100%
    Recalculate Category.CountDiscussions
    Recalculate Category.CountAllDiscussions
    Recalculate Category.CountComments
    Recalculate Category.CountAllComments
    Recalculate Category.LastDiscussionID
    Recalculate Category.LastCommentID
    Recalculate Category.LastDateInserted
    Recalculate Tag.CountDiscussions

  • BTW, the counters may have stopped working after I deleted a user (including data).

  • It's old bug. You must wait until number of discussions or number of comments in discussion will be great then current number. Or you can recalculate counters. Same behavior when you split or merge or move discussions.

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    @x00 said:
    /dba/counts will recalculate

    It can be that there is a denormalise config setting so that counts are updated every post but every n posts, it can also be a problem with caching.

    2.5 is very new, so worth opening an issue on github

    There is a config setting 'Vanilla.Views.Denormalize' used in the DiscussionModel which defaults to false, but I really do not know the purpose of that setting.

    You can try adding $Configuration['Vanilla']['Views']['Denormalize'] = true; to your config.php and see if that changes something... :confused:


  • SugarFreeSugarFree New
    edited March 2018

    adding $Configuration['Vanilla']['Views']['Denormalize'] = true; to config.php didn't change anything. Nor other values: false, '1'.
    I also reinstalled Vanilla 2.5.1, starting with an empty directory. Didn't help.
    Recalculating counters doesn't help either. The counters just don't... count.

  • @Ivan_Gurin said:
    It's old bug. You must wait until number of discussions or number of comments in discussion will be great then current number. Or you can recalculate counters. Same behavior when you split or merge or move discussions.

    does this bug affect everyone, or are some counters more lucky?

  • I'm having the same issue

  • LincLinc Director of Development Detroit Vanilla Staff
    edited March 2018

    @R_J said:
    There is a config setting 'Vanilla.Views.Denormalize' used in the DiscussionModel which defaults to false, but I really do not know the purpose of that setting.

    If you use memcached, we store pageview counts in its cache until it gets to 10 before adding that increment of 10 to the database counter. This reduces writes to the database dramatically. The downside to this is that clearing the cache can lose up to 9 views per discussion, so if you're running a small site and notice tiny increments like that & clear the cache regularly (like during a deploy) it can be irritating. So that config passes thru all the writes to the database, which isn't the worst thing on a low-traffic site. If you're not using memcached, the setting does nothing.

    If you're getting a few thousand or more pageviews a day I'd leave it set to the default.

  • LincLinc Director of Development Detroit Vanilla Staff
    edited March 2018

    Pageview counters in Vanilla happen asynchronously via Javascript to conserve resources and avoid counting bot views. If you have any Javascript errors on your site, that would cause pageviews to stop. In your browser's web development console, look for a call to /settings/analyticstick.json. If it's not firing, look for a Javascript error. If it is firing, look to see if an error is being returned by your server.

  • Did anyone get this fixed? Cause I have the exact same problem and /settings/analyticstick.json seems to work just fine.

  • Is there any update on this? I am looking to set up a new forum and whilst testing Vanilla I moved a post and all category counters except General have stopped incrementing. This would be a show stopper for me as it will only be a low traffic forum (I expect). I ran the ‘dba/count’ script and that fixed the numbers but it is still not updating when I make new posts.
    Is there a setting that I can change?

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    @teppsta said:
    Is there any update on this? I am looking to set up a new forum and whilst testing Vanilla I moved a post and all category counters except General have stopped incrementing. This would be a show stopper for me as it will only be a low traffic forum (I expect). I ran the ‘dba/count’ script and that fixed the numbers but it is still not updating when I make new posts.
    Is there a setting that I can change?

    Nope, no setting. What is not updating?

    a) The total number of discussion for "All Categories"
    b) The number of discussions per category
    c) The number of comments per discussion


  • Hi. Thanks for the response. All Categories, My bookmarks, and My Discussions all increment as expected. None of the category counts are incrementing when I add new posts.

  • Post views and comments increment ok

    miletran168
  • I think everything was working ok until I moved a post to a different category - and after that they stopped moving. If I use the /dba/counts trigger then they reset to the correct numbers but still do not increment thereafter.

    miletran168
  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    @teppsta said:
    Hi. Thanks for the response. All Categories, My bookmarks, and My Discussions all increment as expected. None of the category counts are incrementing when I add new posts.

    When you add a new discussion, you mean.

    If you look at the /categories page, you should see a link to the last discussion below each category. Does this show the correct discussion or is this information is also not updated?


  • rgprgp London New
    edited September 2018

    I have been seeing something similar - number of discussions against each category not updating when a new discussion is added, and the most recent discussion not updating for each category on the forum/categories page.

    I have tracked down the problem, at least for the number of discussions, for my site. Not yet fixed the 'most recent' link, but I suspect the root cause will be similar.

    In my case (on my webhost only, not on my local PC, making debugging more laborious) I traced it back to the fact that PDO seems to be returning all columns as strings. I still haven't worked out why -- the usual reason is if PDO::ATTR_EMULATE_PREPARES is true, but it's false here. I also tried setting PDO::ATTR_STRINGIFY_FETCHES to false (it should be by default anyway), but that made no difference.

    Anyway, the consequence is that the CategoryId on the Discussion record is being returned as a string, so CategoryModel->get() assumes that it's looking for a slug rather than a primary key, and never finds the category to be updated.

    As quick workaround, I have added the following to CategoryModel->incrementLastDiscussion() (unfortunately not in an easily overridable function):

            if (is_numeric($categoryID))
            {
                $categoryID = intval($categoryID);
            }
    

    I'll report back once I've found a fix for the 'most recent discussion' problem, and if I get to the bottom of the PDO behaviour.

    PS: Just noticed that this was posted in '2.5 help' -- my site is actually using 2.6.1.

    R_Jmiletran168
Sign In or Register to comment.