Merge branch 'MDL-35158-23' of git://github.com/grabs/moodle into MOODLE_23_STABLE
This commit is contained in:
@@ -129,11 +129,6 @@ class block_glossary_random extends block_base {
|
||||
$course = $this->page->course;
|
||||
$modinfo = get_fast_modinfo($course);
|
||||
$glossaryid = $this->config->glossary;
|
||||
$cm = $modinfo->instances['glossary'][$glossaryid];
|
||||
|
||||
if (!has_capability('mod/glossary:view', get_context_instance(CONTEXT_MODULE, $cm->id))) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (!isset($modinfo->instances['glossary'][$glossaryid])) {
|
||||
// we can get here if the glossary has been deleted, so
|
||||
@@ -147,6 +142,12 @@ class block_glossary_random extends block_base {
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
$cm = $modinfo->instances['glossary'][$glossaryid];
|
||||
|
||||
if (!has_capability('mod/glossary:view', get_context_instance(CONTEXT_MODULE, $cm->id))) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (empty($this->config->cache)) {
|
||||
$this->config->cache = '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user