Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-25057

Duplicate rows in forum_read from read tracking and forum email subscriptions

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0, 2.6.1, 2.7.2, 2.8
    • Fix Version/s: 2.6.6, 2.7.3
    • Component/s: Forum
    • Database:
      MySQL
    • Testing Instructions:
      Hide
      Before upgrade
      1. Enable debugdisplay and increase your debugging level
      2. Create a new course as teacher
      3. Enrol a student
      4. In the students user preferences, enable forum read tracking
      5. As student, create forum post (verify the student is subscribed by email to the thread as default)
      6. As teacher, write a reply to the post and tick 'reply now'
      7. As a student, reload the new thread (verify you see a new post)
      8. Run cron
      9. As student reload the thread
        • Observe that duplicates were detected (this will be a debug message on the page)
      10. Preferably repeat the above a bit so that there multiple entries
      Upgrade
      1. Update the codebase, and run the upgrade
        • Confirm that the upgrade ran smoothly
      2. Create a new course as teacher
      3. Enrol a student
      4. In the students user preferences, enable forum read tracking
      5. As student, create forum post (verify the student is subscribed by email to the thread as default)
      6. As teacher, write a reply to the post and tick 'reply now'
      7. As a student, reload the new thread (verify you see a new post)
      8. Run cron
      9. As student reload the thread
        • Observe that duplicates were not detected
      Show
      Before upgrade Enable debugdisplay and increase your debugging level Create a new course as teacher Enrol a student In the students user preferences, enable forum read tracking As student, create forum post (verify the student is subscribed by email to the thread as default) As teacher, write a reply to the post and tick 'reply now' As a student, reload the new thread (verify you see a new post) Run cron As student reload the thread Observe that duplicates were detected (this will be a debug message on the page) Preferably repeat the above a bit so that there multiple entries Upgrade Update the codebase, and run the upgrade Confirm that the upgrade ran smoothly Create a new course as teacher Enrol a student In the students user preferences, enable forum read tracking As student, create forum post (verify the student is subscribed by email to the thread as default) As teacher, write a reply to the post and tick 'reply now' As a student, reload the new thread (verify you see a new post) Run cron As student reload the thread Observe that duplicates were not detected
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Pull Master Branch:
      MDL-25057-master

      Description

      1. Create a new course as teacher
      2. Enrol a student
      3. In the students user preferences, enable forum read tracking
      4. As student, create forum post (verify the student is subscribed by email to the thread as defai;t)
      5. As teacher, write a reply to the post and tick 'reply now'
      6. As a student, reload the new thread (verify you see a new post)
      7. Run cron
      8. As student reload the thread

      Expected:
      No debugging messages

      Actual:
      Did you remember to make the first column something unique in your call to get_records? Duplicate value '6' found in column 'id'.
      line 791 of /lib/dml/pgsql_native_moodle_database.php: call to debugging()
      line 1898 of /mod/forum/lib.php: call to pgsql_native_moodle_database->get_records_sql()
      line 5520 of /mod/forum/lib.php: call to forum_get_all_discussion_posts()
      line 354 of /mod/forum/discuss.php: call to forum_print_discussion()

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dobedobedoh Andrew Nicols
              Reporter:
              andyjdavis Andrew Davis
              Peer reviewer:
              Frédéric Massart
              Integrator:
              Marina Glancy
              Tester:
              Sam Hemelryk
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                10/Nov/14