$updateuser->timemodified = time();
$DB->update_record('user', $updateuser);
+
+ // We will update the user's timemodified, as it will be passed to the user_deleted event, which
+ // should know about this updated property persisted to the user's table.
+ $user->timemodified = $updateuser->timemodified;
// notify auth plugin - do not block the delete even when plugin fails
$authplugin = get_auth_plugin($user->auth);
// delete the course and related context instance
delete_context(CONTEXT_COURSE, $courseid);
+
+ // We will update the course's timemodified, as it will be passed to the course_deleted event,
+ // which should know about this updated property, as this event is meant to pass the full course record
+ $course->timemodified = time();
+
$DB->delete_records("course", array("id"=>$courseid));
//trigger events