If a course has Visible set to "Hide", then the link from the Navigation block to a user's forum posts will throw an error.
Steps to reproduce:
- Create a course with a forum activity (simple forum is fine).
- Enrol a student in the course
- Log in to the course as the student.
- As the student, post in the forum activity.
- Enrol a teacher in the course
- Log in as the teacher.
- Set the course's visibility to hidden (e.g. Course Settings->Visible->Hide). Save your changes.
- From the course's main page, in the Navigation block, under current course, click "Participants"
- From the participants page, click the student's name (to get to the student's course profile)
- In the Navigation block, under current course, under the student's name, expand Forum posts, and click "Posts"
- You will be presented with an error forum/notenrolled
With debugging on, the error gives this information:
More information about this error
Error code: notenrolled
line 476 of /lib/setuplib.php: moodle_exception thrown
line 8309 of /mod/forum/lib.php: call to print_error()
line 121 of /mod/forum/user.php: call to forum_get_posts_by_user()
- Set the course's visibility to shown (e.g. Course settings->Visible->Show). Save your changes
- Repeat steps 8, 9, and 10.
- Note that the teacher is able to view the student's posts.