Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-8117

sync('topic') relies on post_id instead of post_time.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • 3.2.2-RC1
    • 3.0.4
    • ACP
    • None

      As per title.

      As far as I know phpBB is supposed to support things like adding posts to a topic with a lower timestamp than the last post (i.e. adding posts between two other posts in the topic). For example a modification might do that.

      While viewtopic etc. order fine by post_time instead of post_id, it looks like the sync() function doesn't take into account that the lowest post_id does not necessarily need to be the topic's first_post_id.

      Some snippets ...

      $sql = 'SELECT t.topic_id, t.post_approved, COUNT(t.post_id) AS total_posts, MIN(t.post_id) AS first_post_id, MAX(t.post_id) AS last_post_id

      $topic_data[$topic_id]['first_post_id'] = (!$topic_data[$topic_id]['first_post_id']) ? $row['first_post_id'] : min($topic_data[$topic_id]['first_post_id'], $row['first_post_id']); 

            CHItA CHItA
            bantu Andreas Fischer [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: