diff --git a/report/competency/classes/output/user_course_navigation.php b/report/competency/classes/output/user_course_navigation.php
index 536d96376b8..57735788ede 100644
--- a/report/competency/classes/output/user_course_navigation.php
+++ b/report/competency/classes/output/user_course_navigation.php
@@ -82,6 +82,10 @@ class user_course_navigation implements renderable, templatable {
$data->userid = $this->userid;
$data->courseid = $this->courseid;
$data->moduleid = $this->moduleid;
+ if (empty($data->moduleid)) {
+ // Moduleid is optional.
+ $data->moduleid = 0;
+ }
$data->baseurl = $this->baseurl;
$data->groupselector = '';
diff --git a/report/competency/templates/report.mustache b/report/competency/templates/report.mustache
index e1e2191d7f1..24622d7f346 100644
--- a/report/competency/templates/report.mustache
+++ b/report/competency/templates/report.mustache
@@ -1,3 +1,27 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see
{{{groupselector}}}