MDL-32238 course: Timemodifed should be updated when a course's visible status is toggled from the category page

This commit is contained in:
Ankit Agarwal
2012-04-24 13:41:28 +08:00
parent 93fb7b528b
commit 525a4642cd
+2 -4
View File
@@ -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()));
}
}