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

Incorrect unread topic tracking for unapproved topics

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.6
    • Fix Version/s: 3.0.10-RC1
    • Component/s: Other
    • Labels:
      None

      Description

      When functions_posting.php runs update_forum_tracking_info() after a new post, it doesn't exclude unapproved topics. This creates problems. Imagine this sequence:

      • user 1 marks all forums read (just to make this simple to follow )
      • user 2 posts a new topic in forum A and that topic has to be approved before user 1 can see it
      • user 1 posts a new post or reply in forum A (before anyone else posts again)...that triggers update_forum_tracking_info()
      • since user 1 has read all approved topics in the forum, update_forum_tracking() is supposed to mark the forum read
      • but instead, update_forum_tracking_info incorrectly concludes that there still are unread posts (because the topic last post time for the unapproved topic is greater than the relevant mark time) and therefore does NOT reset the mark time for the forum
      • user 1 then goes to the index and it tells him that forum A is if unread (because user 1's own last post has a post time greater than the relevant mark time for forum 1).

      Here's a fix:

      OPEN
      includes/functions.php
       
      FIND
      	global $db, $tracking_topics, $user, $config;
       
      REPLACE WITH
      	global $db, $tracking_topics, $user, $config, $auth;
       
      FIND
      			$sql = 'SELECT t.forum_id FROM ' . TOPICS_TABLE . ' t
       
      BEFORE, ADD
      			$sql_approved = ($auth->acl_get('m_approve', $forum_id)) ? '': 'AND t.topic_approved = 1';
       
      FIND
      					AND t.topic_moved_id = 0
       
      AFTER, ADD
      					' . $sql_approved . '
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rxu rxu
                Reporter:
                asinshesq asinshesq
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: