-
Bug
-
Resolution: Fixed
-
Major
-
1.7.2, 1.8.2, 1.9
-
None
-
MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE
-
MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE
In .../enrol/ldap/enrol.php, line 75, there is this line of code:
if ($course_obj->visible==0 && $user->{$type}[$course_obj->id] == 'ldap') {
but $type is not defined in the function scope. In fact, it's a leftover from the pre-roles enrolment code: it was used to specify the user type (student or teacher). In addition to that, the enrolments are no longer stored in $user->student or $user->teacher, so the second test condition of the sentence doesn't make sense.
Considering that all of the courses that are dealt with at that line are ldap enrolled courses, we can simply remove the second test and leave it like this:
if ($course_obj->visible==0) {
The attached patch applies cleanly to 1.7.2+, 1.8.2+ and 1.9beta as of today.
Saludos. Iñaki.