Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-7964

Resync post count sets post count for all users to 0

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 3.0.4
    • 3.0.3
    • ACP
    • None
    • PHP Environment:
      Database:

      This is a duplicate of PHPBB3-7937, but that was closed as unreproducable. If the correct procedure would have been to reply to that ticket, apologies.

      Working with the reporter of the previous bug, we found out what is most likely going on. The user has pruning enabled. The current code in acp_main.php works out a certain batch size and then starts selecting counts based on the post ID, with post IDs between an upper and a lower limit, determined by the batch size.

      If there are no results in the batch, the code assumes it has reached the end of the entire post ID range and bails out.

      However, if there is a gap in the post IDs larger than the batch size, for example due to pruning, there will be empty batches halfway through the process, causing the process to stop prematurely.

      Attached you find an SVN patch that modifies the code by finding the maximum post ID (by examing the last post IDs from the forums table, I thought that might be more efficient than going to the actual posts table) and only stopping if the lower limit of the batch is bigger than the last post ID. I have added a log message in case the last post ID can not be found, which needs to be added to a language file somewhere.

            Acyd Burn Meik Sievertsen [X] (Inactive)
            Eelke Eelke Blok [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: