diff --git a/edit.php b/edit.php index 72dd9a5..60cf5b7 100644 --- a/edit.php +++ b/edit.php @@ -232,7 +232,7 @@ if ($data = $mform->get_data()) { echo $OUTPUT->header(); echo $OUTPUT->heading(get_string('editcustomcert', 'customcert')); $mform->display(); -if ($tid) { +if ($tid && $context->contextlevel == CONTEXT_MODULE) { $loadtemplateurl = new moodle_url('/mod/customcert/load_template.php', array('tid' => $tid)); $loadtemplateform = new \mod_customcert\load_template_form($loadtemplateurl, array('context' => $context), 'post', '', array('id' => 'loadtemplateform'));