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);

        Activity

        Hide
        nickvergessen Joas Schilling added a comment -

        Geolim4 do you want to make a patch for this?

        Show
        nickvergessen Joas Schilling added a comment - Geolim4 do you want to make a patch for this?
        Hide
        Geolim4 Geolim4 added a comment -

        @Joas: Where? On Github?

        Show
        Geolim4 Geolim4 added a comment - @Joas: Where? On Github?
        Hide
        nickvergessen Joas Schilling added a comment -

        Yes, if you know tests and have time, it would be nice if you add some

        Show
        nickvergessen Joas Schilling added a comment - Yes, if you know tests and have time, it would be nice if you add some
        Hide
        Geolim4 Geolim4 added a comment -

        For now i'm not in ease with git(hub) (yes it's serious) i'm working on it, so i will ask to my coders if they can help me to do the patch :/

        Show
        Geolim4 Geolim4 added a comment - For now i'm not in ease with git(hub) (yes it's serious) i'm working on it, so i will ask to my coders if they can help me to do the patch :/

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development