MDL-34549 libraries: Replace get_context_instance_by_id() by context::instance_by_id()
This commit is contained in:
+2
-2
@@ -1106,7 +1106,7 @@ function question_category_options($contexts, $top = false, $currentcat = 0,
|
||||
$categoriesarray = array();
|
||||
foreach ($pcontexts as $pcontext) {
|
||||
$contextstring = print_context_name(
|
||||
get_context_instance_by_id($pcontext), true, true);
|
||||
context::instance_by_id($pcontext), true, true);
|
||||
foreach ($categories as $category) {
|
||||
if ($category->contextid == $pcontext) {
|
||||
$cid = $category->id;
|
||||
@@ -1333,7 +1333,7 @@ function question_has_capability_on($question, $cap, $cachecat = -1) {
|
||||
}
|
||||
}
|
||||
$category = $categories[$question->category];
|
||||
$context = get_context_instance_by_id($category->contextid);
|
||||
$context = context::instance_by_id($category->contextid);
|
||||
|
||||
if (array_search($cap, $question_questioncaps)!== false) {
|
||||
if (!has_capability('moodle/question:' . $cap . 'all', $context)) {
|
||||
|
||||
Reference in New Issue
Block a user