Closed mlohoar closed 4 years ago
fix on 25 Feb 2020
Hi,
I have the same issue and it allows to show the current course on the course list in restrictions.
It happens because $course variable is overridden in line 56:
$course = get_courses();
So the fix is simple: just change variable name in lines 56 and 57 for example like this:
$courses = get_courses();
foreach ($courses as $othercm) {
Fixed
Just did an install via zip and got a notice when creating a new activity. The code at line 56: $course = get_courses(); foreach ($course as $othercm) {
messes up the line 59 if(($othercm->category > 0) && ($othercm->id != $course->id)){
as $course is now an array.
Suggest change lines 56 & 57 to: $others= get_courses(); foreach ($other as $othercm) {