Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-11520

Post count not incremented when you fork a topic

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.11
    • Fix Version/s: 3.1.0-RC3
    • Component/s: Posting
    • Labels:
      None
    • Environment:
      PHP 5.4.3, MySQL 5.1.3, Firefox 20

      Description

      When you fork a topic, the post's count of each users is not incremented depending number of post of each users.

      User user01
      -Create a new topic with user01. (user01 got +1 post on his counter)
      -Fork this topic using moderation tool (user01 will not got +1 post on his counter)
      -Delete the copied topic (user01 got -1 post on his counter)

      User has now 0 post on his counter even with the first topic manually writed.

      Solution:
      Open includes/mcp/mcp_main.php
      Search(line 1181):
      'post_postcount' => 0,

      Replace with:
      'post_postcount' => (int) $row['post_postcount'],

      Search(line 1184):
      $db->sql_query('INSERT INTO ' . POSTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));

      Add After:
      $sql = 'UPDATE ' . USERS_TABLE . '
      SET user_posts = user_posts + 1
      WHERE user_id = ' . (int) $row['poster_id'];
      $db->sql_query($sql);

        Attachments

          Activity

            People

            • Assignee:
              Marc Marc
              Reporter:
              Geolim4 Geolim4
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: