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

Forum overview 'new posts' functionality returns incorrect results and is horribly slow

    Details

    • Database:
      Any, PostgreSQL
    • Testing Instructions:
      Hide
      1. As an admin create / go to a course and add 'UserA' as a student and 'UserB' as a teacher
      2. Login as UserA, go to "My moodle" page, enable the course overview block and check the number of new forum posts listed (if there are new forum posts)
      3. Visit the course as UserB and create a new forum
      4. Visit the "My Moodle" page as UserA and check that the number of new forum posts is the same
      5. Visit the course as UserB and create a new forum discussion
      6. Visit the "My Moodle" page as UserA and check that the number of new forum posts has been increased by one
      7. Visit the course as UserB and create a new forum post to the discussion
      8. Visit the "My Moodle" page as UserA and check that the number of new forum posts has been increased by one
      9. Visit the course as UserA, read the forum posts and logout
      10. Login again as UserA and visit the "My Moodle" page to check that there are no pending posts
      Show
      As an admin create / go to a course and add 'UserA' as a student and 'UserB' as a teacher Login as UserA, go to "My moodle" page, enable the course overview block and check the number of new forum posts listed (if there are new forum posts) Visit the course as UserB and create a new forum Visit the "My Moodle" page as UserA and check that the number of new forum posts is the same Visit the course as UserB and create a new forum discussion Visit the "My Moodle" page as UserA and check that the number of new forum posts has been increased by one Visit the course as UserB and create a new forum post to the discussion Visit the "My Moodle" page as UserA and check that the number of new forum posts has been increased by one Visit the course as UserA, read the forum posts and logout Login again as UserA and visit the "My Moodle" page to check that there are no pending posts
    • Workaround:
      Hide

      Avoid log table

      Show
      Avoid log table
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-32931_master

      Description

      The forum overview used by the course overview block counts the number of new posts in forum discussions for courses in which the user is enrolled.

      This currently does not return the correct results; its search method is to scan the log table for 'add post' actions - however, posts can be added through other means without an 'add post' action being logged (for example, during the start of a new discussion, a new post is added but only the action 'add discussion' is logged).

      A side consequence of using the database log table for this work is that it can by abysmally slow given a large dataset in the log table. This is especially the case when scanning for new posts in a course which the user has never accessed ($course->lastaccess == 0) as this can then do a scan on the entirety of the log table for all posts since the beginning of the Moodle and can cause cache evictions from the database buffers for other, more useful data.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                5 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Sep/12