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

Replace add_to_log with an event trigger - mod_forum

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5, 2.7
    • Fix Version/s: 2.7
    • Component/s: Events API, Logging
    • Labels:
    • Testing Instructions:
      Hide

      (Note from Dan: I've given the basic overview rather than every single step. Hopefully you get the idea - you should be clicking on the log links and doing various forum steps and doing a sanity check on the log entries).

      1. Create a new standard forum in a course
      2. Create a new discussion
      3. Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense
      1. Create a new post
      2. Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense
      1. Create a new single discussion activity
      2. Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense
      1. Create a new forum in the same course
      2. Move a forum thread from first place to second
      3. Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense
      1. View the forum index page
      2. Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense
      1. Create multiple posts on a single discussion, then choose to split one of the posts to a new thread using the split control
      2. Ensure multiple log entries have been created (discussion updated, post updated, discussion created), click the links, ensure they goes to somewhere which makes sense
      1. Delete a forum discussion
      2. Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense
      1. View a forum discussion
      2. Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense
      1. Search for a forum post in the forum search interface
      2. Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense
      1. Go to a users forum post report (in their profile)
      2. Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense
      1. Go to a users forum discussion report (in their profile)
      2. Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense
      1. As a student, subscribe to a forum
      2. Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense
      1. As a student, unsubscribe from a forum
      2. Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense
      1. As a student, create a new forum thread and select the 'subscribe me to this forum' option
      2. Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense
      1. Ensure read tracking is enabled in the site/forum/user settings
      2. In a forum click the 'track unread posts on this forum'.
      3. Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense
      1. Ensure read tracking is enabled in the site/forum/user settings
      2. In a forum click the 'do not track unread posts on this forum'.
      3. Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense
      Show
      (Note from Dan: I've given the basic overview rather than every single step. Hopefully you get the idea - you should be clicking on the log links and doing various forum steps and doing a sanity check on the log entries). Create a new standard forum in a course Create a new discussion Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense Create a new post Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense Create a new single discussion activity Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense Create a new forum in the same course Move a forum thread from first place to second Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense View the forum index page Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense Create multiple posts on a single discussion, then choose to split one of the posts to a new thread using the split control Ensure multiple log entries have been created (discussion updated, post updated, discussion created), click the links, ensure they goes to somewhere which makes sense Delete a forum discussion Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense View a forum discussion Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense Search for a forum post in the forum search interface Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense Go to a users forum post report (in their profile) Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense Go to a users forum discussion report (in their profile) Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense As a student, subscribe to a forum Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense As a student, unsubscribe from a forum Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense As a student, create a new forum thread and select the 'subscribe me to this forum' option Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense Ensure read tracking is enabled in the site/forum/user settings In a forum click the 'track unread posts on this forum'. Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense Ensure read tracking is enabled in the site/forum/user settings In a forum click the 'do not track unread posts on this forum'. Ensure a log entry has been created, click the link, ensure it goes to somewhere which makes sense
    • Affected Branches:
      MOODLE_25_STABLE, MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE
    • Pull Master Branch:
      MDL-40062-master
    • Story Points (Obsolete):
      40
    • Sprint:
      BACKEND Sprint 10

      Description

      Replace the add_to_log calls for the following area, with a call to the get_legacy_logdata function in the event class.

      mod/forum (24 calls)
      /mod/forum/discuss.php:95: add_to_log($course->id, 'forum', 'move discussion', "discuss.php?d=$discussion->id", $discussion->id, $cmto->id);
      /mod/forum/discuss.php:107: add_to_log($course->id, 'forum', 'view discussion', "discuss.php?d=$discussion->id", $discussion->id, $cm->id);
      /mod/forum/subscribe.php:152: add_to_log($course->id, "forum", "unsubscribe", "view.php?f=$forum->id", $forum->id, $cm->id);
      /mod/forum/subscribe.php:177: add_to_log($course->id, "forum", "subscribe", "view.php?f=$forum->id", $forum->id, $cm->id);
      /mod/forum/markposts.php:85: add_to_log($course->id, "discussion", "mark read", "view.php?f=$forum->id", $d, $cm->id);
      /mod/forum/markposts.php:96: add_to_log($course->id, "forum", "mark read", "view.php?f=$forum->id", $forum->id, $cm->id);
      /mod/forum/markposts.php:103: // add_to_log($course->id, "forum", "mark unread", "view.php?f=$forum->id", $forum->id, $cm->id);
      /mod/forum/index.php:54: add_to_log($course->id, 'forum', 'view forums', "index.php?id=$course->id");
      /mod/forum/index.php:183: add_to_log($course->id, 'forum', 'subscribeall', "index.php?id=$course->id", $course->id);
      /mod/forum/index.php:186: add_to_log($course->id, 'forum', 'unsubscribeall', "index.php?id=$course->id", $course->id);
      /mod/forum/settracking.php:63: add_to_log($course->id, "forum", "stop tracking", "view.php?f=$forum->id", $forum->id, $cm->id);
      /mod/forum/settracking.php:71: add_to_log($course->id, "forum", "start tracking", "view.php?f=$forum->id", $forum->id, $cm->id);
      /mod/forum/lib.php:742: add_to_log($course->id, 'forum', 'mail error', "discuss.php?d=$discussion->id#p$post->id",
      /mod/forum/lib.php:1040: add_to_log($course->id, 'forum', 'mail digest error', '', '', $cm->id, $userto->id);
      /mod/forum/user.php:65: add_to_log(($isspecificcourse)?$courseid:SITEID, "forum", "user report", 'user.php?'.$url->get_query_string(), $userid);
      /mod/forum/post.php:336: add_to_log($discussion->course, "forum", "delete discussion",
      /mod/forum/post.php:353: add_to_log($discussion->course, "forum", "delete post", $discussionurl, "$post->id", $cm->id);
      /mod/forum/post.php:454: add_to_log($discussion->course, "forum", "prune post",
      /mod/forum/post.php:682: add_to_log($course->id, "forum", "update post",
      /mod/forum/post.php:725: add_to_log($course->id, "forum", "add post",
      /mod/forum/post.php:772: add_to_log($course->id, "forum", "add discussion",
      /mod/forum/subscribers.php:57: add_to_log($course->id, "forum", "view subscribers", "subscribers.php?id=$forum->id", $forum->id, $cm->id);
      /mod/forum/view.php:131: add_to_log($course->id, "forum", "view forum", "view.php?id=$cm->id", "$forum->id", $cm->id);
      /mod/forum/view.php:133: add_to_log($course->id, "forum", "view forum", "view.php?f=$forum->id", "$forum->id");
      /mod/forum/search.php:115: add_to_log($course->id, "forum", "search", "search.php?id=$course->id&search=".urlencode($search), $search);

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    12/May/14