MDL-70099 enrol: increase accuracy of current enrolments by date.

By rounding the current time it was possible that the most recently
created user enrolments (e.g. self enrolments) were being excluded.

This would manifest itself in a user being enrolled on a course,
but it not appearing under "My courses" navigation or on their own
Dashboard until the rounded time had caught up with the current
time.
This commit is contained in:
Paul Holden
2021-04-05 19:32:25 +01:00
parent c54de9bec2
commit c3b4e76768
4 changed files with 59 additions and 4 deletions
+2 -1
View File
@@ -3670,7 +3670,8 @@ class navbar extends navigation_node {
}
// Don't show the 'course' node if enrolled in this course.
if (!is_enrolled(context_course::instance($this->page->course->id, null, '', true))) {
$coursecontext = context_course::instance($this->page->course->id);
if (!is_enrolled($coursecontext, null, '', true)) {
$courses = $this->page->navigation->get('courses');
if (!$courses) {
// Courses node may not be present.