Skip to content

Commit

Permalink
Merge branch 'w02_MDL-30928_m23_deletetimes' of git://github.com/skod…
Browse files Browse the repository at this point in the history
…ak/moodle
  • Loading branch information
Sam Hemelryk committed Jan 9, 2012
2 parents 9b1ab84 + e7157a0 commit 1bec282
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/moodlelib.php
Expand Up @@ -3794,6 +3794,10 @@ function delete_user($user) {
$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);
Expand Down Expand Up @@ -4277,6 +4281,11 @@ function delete_course($courseorid, $showfeedback = true) {

// 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
Expand Down

0 comments on commit 1bec282

Please sign in to comment.