diff --git a/mod/resource/filter.php b/mod/resource/filter.php index 912216dc55e..63427bfe787 100644 --- a/mod/resource/filter.php +++ b/mod/resource/filter.php @@ -14,6 +14,11 @@ return $text; } + // if we don't have a courseid, we can't run the query, so + if (empty($courseid)) { + return $text; + } + /// Create a list of all the resources to search for. It may be cached already. if (empty($resourcelist)) {