From 10b4ac6dd326cbf83c2d65bf247b9ecb3bba45fc Mon Sep 17 00:00:00 2001 From: Jane Adelmann Date: Fri, 1 Oct 2021 14:12:47 +0300 Subject: [PATCH] Fix plugin when context is null. Version 3.7.5 --- lib.php | 4 ++++ version.php | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib.php b/lib.php index dc3f2e8..59e1a2f 100644 --- a/lib.php +++ b/lib.php @@ -77,6 +77,10 @@ class plagiarism_plugin_pchkorg extends plagiarism_plugin { $context = context_module::instance($cmid);// Get context of course. } + if (empty($context)) { + return ''; + } + $canview = has_capability(capability::VIEW_SIMILARITY, $context); if (!$canview) { return ''; diff --git a/version.php b/version.php index 86f3fde..94ef462 100644 --- a/version.php +++ b/version.php @@ -26,9 +26,9 @@ defined('MOODLE_INTERNAL') || die(); if (!isset($plugin)) { $plugin = new stdClass(); } -$plugin->version = 2021092804; +$plugin->version = 2021100101; $plugin->requires = 2017051500; // Requires Moodle 3.3 . -$plugin->release = 'v3.7.4'; +$plugin->release = 'v3.7.5'; $plugin->maturity = MATURITY_STABLE; $plugin->component = 'plagiarism_pchkorg'; $plugin->dependencies = array(