Permalink
Browse files

Merge branch 'wip-MDL-27756-MOODLE_20_STABLE' of github.com:marinagla…

…ncy/moodle into MOODLE_20_STABLE
  • Loading branch information...
2 parents 60e7f2b + be1f4ab commit ef5a198d1c5ad2078a6f0e244777f9db0b78a367 @samhemelryk samhemelryk committed Jul 18, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 course/lib.php
View
@@ -3366,10 +3366,13 @@ function move_courses($courseids, $categoryid) {
}
$courseids = array_reverse($courseids);
+ $newparent = get_context_instance(CONTEXT_COURSECAT, $category->id);
$i = 1;
foreach ($courseids as $courseid) {
if ($course = $DB->get_record('course', array('id'=>$courseid), 'id, category')) {
+ $course = new stdClass();
+ $course->id = $courseid;
$course->category = $category->id;
$course->sortorder = $category->sortorder + MAX_COURSES_IN_CATEGORY - $i++;
if ($category->visible == 0) {
@@ -3381,7 +3384,6 @@ function move_courses($courseids, $categoryid) {
$DB->update_record('course', $course);
$context = get_context_instance(CONTEXT_COURSE, $course->id);
- $newparent = get_context_instance(CONTEXT_COURSECAT, $course->category);
context_moved($context, $newparent);
}
}

0 comments on commit ef5a198

Please sign in to comment.