Skip to content

Commit

Permalink
MDL-47494 ddmarker: Fix use of deprecated accesslib functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
timhunt committed Jan 31, 2014
1 parent 9d26e5b commit 3c3633b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion question/type/ddmarker/lib.php
Expand Up @@ -44,7 +44,7 @@ function qtype_ddmarker_pluginfile($course, $cm, $context, $filearea, $args, $fo
function qtype_ddmarker_course_context_id($catcontextid) {
$context = context::instance_by_id($catcontextid);
while ($context->contextlevel != CONTEXT_COURSE) {
$context = context::instance_by_id(get_parent_contextid($context));
$context = $context->get_parent_context();
}
return $context->id;
}
Expand Down
10 changes: 5 additions & 5 deletions question/type/ddmarker/questionlists.php
Expand Up @@ -169,7 +169,7 @@ public function parent_node() {
}

public function item_name() {
return print_context_name($this->record);
return context_helper::preload_from_record($this->record)->get_context_name();
}

public function course_context_id() {
Expand Down Expand Up @@ -218,10 +218,10 @@ public function __construct($stringidentifier, $link, $contextids) {
if (!isset($this->records[$contextid])) {
$this->records[$contextid] = context::instance_by_id($contextid);
}
$parents = get_parent_contexts($this->records[$contextid]);
foreach ($parents as $parentcontextid) {
if (!isset($this->records[$parentcontextid])) {
$this->records[$parentcontextid] = context::instance_by_id($parentcontextid);
$parents = $this->records[$contextid]->get_parent_contexts();
foreach ($parents as $parentcontext) {
if (!isset($this->records[$parentcontext->id])) {
$this->records[$parentcontext->id] = $parentcontext;
}
}
}
Expand Down

0 comments on commit 3c3633b

Please sign in to comment.