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

phpBB 3.1.0+ migration counts unapproved posts wrong

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.0.0
    • Fix Version/s: None
    • Component/s: Update system
    • Labels:
    • Environment:
      CentOS 7.5.1804, Apache/2.4.6 (CentOS), PostgreSQL 9.2.23, PHP 5.4.16, Firefox 52

      Description

      Shadow topics have their (un)approved posts count only synchronized when viewed in viewforum.php.
      phpBB 3.1.0 introduces the softdelete feature.
      phpBB 3.1.0 replaces forum_id_unapproved_topics with forum_posts_unapproved.
      The migration script (phpbb/db/migration/data/v310/softdelete_p1.php) recalculates forum totals of (un)approved post counts.
      The script wrongly includes shadow topics' (un)approved post counts.

      That means this can happen, which happened to me:

      • A topic has a post marked as unapproved.
      • Moderator A moves a topic that has unapproved posts.
      • Moderator A approves all posts in the moved topic.
      • There are now no unapproved posts in phpbb_posts.
      • Nobody ever views the shadow topic in viewforum, it doesn't get updated.
      • The shadow topic contains the pre-move unapproved post count.
      • phpBB 3.0.X doesn't display if a forum has unapproved posts, only topics.
      • phpBB 3.0.X doesn't display topics with unapproved posts in the MCP.
      • Everything seems fine.
      • phpBB is updated to phpBB 3.1.0 or higher.
      • Forums now hold a count of their unapproved posts.
      • phpbb/db/migration/data/v310/softdelete_p1.php adds shadow topics to this count.
      • phpBB 3.1.0 onwards display if a forum has unapproved posts in it.
      • Forums with these 'bad' shadow topics are marked as having unapproved posts.
      • phpBB still doesn't display topics with unapproved posts in the MCP.
      • Viewing the shadow post will not decrement the count.

        Attachments

        1. 1.png
          1.png
          92 kB
        2. 2.png
          2.png
          92 kB
        3. 3.png
          3.png
          90 kB

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              GlarWebVI GlarWebVI [X] (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: