From 525a4642cd9e510f104a71d67d63e6ef8c75ccfa Mon Sep 17 00:00:00 2001 From: Ankit Agarwal Date: Tue, 24 Apr 2012 10:08:23 +0800 Subject: [PATCH] MDL-32238 course: Timemodifed should be updated when a course's visible status is toggled from the category page --- course/category.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/course/category.php b/course/category.php index 496ff1d1067..a361f0f9b91 100644 --- a/course/category.php +++ b/course/category.php @@ -131,10 +131,8 @@ if ($editingon && $sesskeyprovided) { if ($course) { $coursecontext = get_context_instance(CONTEXT_COURSE, $course->id); require_capability('moodle/course:visibility', $coursecontext); - // Set the visibility of the course - $DB->set_field('course', 'visible', $visible, array('id' => $course->id)); - // we set the old flag when user manually changes visibility of course - $DB->set_field('course', 'visibleold', $visible, array('id' => $course->id)); + // Set the visibility of the course. we set the old flag when user manually changes visibility of course. + $DB->update_record('course', array('id' => $course->id, 'visible' => $visible, 'visibleold' => $visible, 'timemodified' => time())); } }