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

Move related code from functions_posting into remove_post_from_statistic()

    Details

    • Type: Improvement
    • Status: Unverified Fix
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.0-b4
    • Fix Version/s: 3.1.0-RC3
    • Component/s: Posting
    • Labels:
      None

      Description

      if ($data['post_visibility'] == ITEM_APPROVED)
      {
      	$phpbb_content_visibility->remove_post_from_statistic($data, $sql_data);
      }
      else if ($data['post_visibility'] == ITEM_UNAPPROVED || $data['post_visibility'] == ITEM_REAPPROVE)
      {
      	$sql_data[FORUMS_TABLE] = (($sql_data[FORUMS_TABLE]) ? $sql_data[FORUMS_TABLE] . ', ' : '') . 'forum_posts_unapproved = forum_posts_unapproved - 1';
      	$sql_data[TOPICS_TABLE] = (($sql_data[TOPICS_TABLE]) ? $sql_data[TOPICS_TABLE] . ', ' : '') . 'topic_posts_unapproved = topic_posts_unapproved - 1';
      }
      else if ($data['post_visibility'] == ITEM_DELETED)
      {
      	$sql_data[FORUMS_TABLE] = (($sql_data[FORUMS_TABLE]) ? $sql_data[FORUMS_TABLE] . ', ' : '') . 'forum_posts_softdeleted = forum_posts_softdeleted - 1';
      	$sql_data[TOPICS_TABLE] = (($sql_data[TOPICS_TABLE]) ? $sql_data[TOPICS_TABLE] . ', ' : '') . 'topic_posts_softdeleted = topic_posts_softdeleted - 1';
      }
      

      The extra logic should be moved into remove_post_from_statistic( ) too as it just removing post from forum and topic table stats.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            dhruv.goel92 Dhruv Goel
            Reporter:
            dhruv.goel92 Dhruv Goel
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development