mirror of
https://github.com/moodle/moodle.git
synced 2025-02-15 05:15:07 +01:00
Merge branch 'MDL-35158-master' of git://github.com/grabs/moodle
This commit is contained in:
commit
7b83e3019d
@ -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', context_module::instance($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', context_module::instance($cm->id))) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (empty($this->config->cache)) {
|
||||
$this->config->cache = '';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user