Moodle
  1. Moodle
  2. MDL-4143

No calendar events for student who is teacher in some course

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.5.2
    • Fix Version/s: None
    • Component/s: Calendar
    • Labels:
      None
    • Environment:
      All
    • Affected Branches:
      MOODLE_15_STABLE
    • Rank:
      7666

      Description

      One of my students who is also a teacher in another course does not see any of the course events from the courses whe is a student in. As soon as I remove her from her teacher role she can immediately see all the events again.

        Activity

        Hide
        Martin Dougiamas added a comment -

        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).

        Also, would

        $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...

        Additions:

        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...

        Show
        Martin Dougiamas added a comment - 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). Also, would $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... Additions: 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...
        Hide
        Michael Blake added a comment -

        Temporary transition to reassign bug to "pj".

        Show
        Michael Blake added a comment - Temporary transition to reassign bug to "pj".
        Hide
        Michael Blake added a comment -

        Re-closing bugs after re-assigning to "pj".

        Show
        Michael Blake added a comment - Re-closing bugs after re-assigning to "pj".

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: