From Jon Papaioannou (pj at moodle.org) Friday, 21 October 2005, 08:30 AM:
Fixed in 1.5.x and HEAD.
From Samuli Karevaara (samuli.karevaara at lamk.fi) Friday, 11 November 2005, 01:04 AM:
This CVS-change looked familiar, and I realized that this was mentioned in the comments for the
MDL-4039. Got buried there, though...
if(isset($USER->student) && is_array($USER->student))
$courses = $courses + $USER->student;
if(isset($USER->teacher) && is_array($USER->teacher))
$courses = $courses + $USER->teacher;
The upper addition seems unnecessary, as the $courses array is always empty at that point (the upper if block returns).
$courses += $USER->teacher;
do as one would think? (A small step away from basic
(all of this comment served no purpose... lack of sugar and coffee, apologies
From Jon Papaioannou (pj at moodle.org) Friday, 11 November 2005, 11:35 PM:
100% right... apologies for not acting on
MDL-4039 before. I had it somewhere at the back of my mind and then forgotten...
1. The upper addition is indeed not needed now, but I thought it would be best to have it anyway. Otherwise, if we add some code before that in the future it will break.
2. Unless some PHP developers need hanging from a lamp post, += would do what we both believe it would do. However, adding arrays like that is a very rare operation so I wrote it as verbosely as I could in order to not confuse anyone who might read that code.
I think we can live with a few bytes of verbosity more...