mirror of
https://github.com/moodle/moodle.git
synced 2025-04-18 23:15:38 +02:00
category paths: MDL-18897 call fix_course_sortorder eveywhere we insert a category to set category.path and .depth
This commit is contained in:
parent
3bba572f0e
commit
7a9d505bb9
@ -75,6 +75,7 @@ if ($mform->is_cancelled()) {
|
||||
}
|
||||
$newcategory->context = get_context_instance(CONTEXT_COURSECAT, $newcategory->id);
|
||||
mark_context_dirty($newcategory->context->path);
|
||||
fix_course_sortorder(); // Required to build course_categories.depth and .path.
|
||||
}
|
||||
redirect('category.php?id='.$newcategory->id.'&categoryedit=on');
|
||||
}
|
||||
|
@ -153,6 +153,7 @@
|
||||
}
|
||||
$tempcat->context = get_context_instance(CONTEXT_COURSECAT, $tempcat->id);
|
||||
mark_context_dirty('/'.SYSCONTEXTID);
|
||||
fix_course_sortorder(); // Required to build course_categories.depth and .path.
|
||||
}
|
||||
|
||||
/// Move a category to a new parent if required
|
||||
|
@ -1221,6 +1221,7 @@ function get_course_category($catid=0) {
|
||||
// make sure category context exists
|
||||
get_context_instance(CONTEXT_COURSECAT, $catid);
|
||||
mark_context_dirty('/'.SYSCONTEXTID);
|
||||
fix_course_sortorder(); // Required to build course_categories.depth and .path.
|
||||
$category = $DB->get_record('course_categories', array('id'=>$catid));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user