Prevent exception when adding 'teachername' element to site template (#261)
This commit is contained in:
parent
c85d7e0edc
commit
61e18a647b
1 changed files with 5 additions and 0 deletions
|
@ -102,6 +102,11 @@ class element extends \mod_customcert\element {
|
||||||
protected function get_list_of_teachers() {
|
protected function get_list_of_teachers() {
|
||||||
global $PAGE;
|
global $PAGE;
|
||||||
|
|
||||||
|
// Return early if we are in a site template.
|
||||||
|
if ($PAGE->context->id == \context_system::instance()->id) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
// The list of teachers to return.
|
// The list of teachers to return.
|
||||||
$teachers = array();
|
$teachers = array();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue