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

Course reset does not delete forum posts properly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.9, 2.0
    • 1.6.4
    • Forum
    • None
    • Linux and Windows, PHP 5, MySQL 5
    • MySQL
    • MOODLE_16_STABLE
    • MOODLE_19_STABLE, MOODLE_20_STABLE

      When the course reset is made post are deleted from mdl_forum_posts table (which is ok) but they are not deleted from mdl_forum_discussions. As a result the number of posts in the forum is such as if poste where still there. This number of post is displayed when user is entering the forum, which is very misleading.

      We suggest the following fix:

      in mod/forum/lib.php, in function forum_delete_userdata(...) the sql query should be:

      $sql = 'DELETE FROM '.$CFG->prefix.'forum_posts, '.$CFG->prefix.'forum_discussions
      USING '.$CFG->prefix.'forum_discussions ,
      '.$CFG->prefix.'forum_posts ,
      '.$CFG->prefix.'forum
      WHERE '.$CFG->prefix.'forum_posts.discussion = '.$CFG->prefix.'forum_discussions.id AND '.$CFG->prefix.'forum.course='.$data->courseid.' AND '.$CFG->prefix.'forum.id = '.$CFG->prefix.'forum_discussions.forum';

            skodak Petr Skoda
            piokoch Pio Ko (Inactive)
            Nobody Nobody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.