Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-65958

Creating a Course calendar event only displays enrolled courses for admin

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      Testing scenario 1: Admin
      1. Log in as admin.
      2. Go to Site administration > Appearance > Calendar and make sure calendar_adminseesall setting is disabled.
      3. Create 3 courses (or use an existing)
      4. Enrol yourself (admin) in only 2 of those 3 courses.
      5. Go to Calendar and click New event button
      6. In the event form, select Course event type.
      7. Click in the course selector and then press (down) key to see all available courses.
      8. Make sure you just see the courses you are enrolled in.
      9. Now, go back to Site administration > Appearance > Calendar and enable the calendar_adminseesall setting.
      10. Go to Calendar and click New event button.
      11. Select Course event type, click in the course selector and press (down) key.
      12. Make sure you see ALL the courses, not just the ones you are enrolled in.
      Testing scenario 2: Teacher
      1. As admin, enrol a user (t1) as teacher in one of those 3 courses.
      2. Log in as t1 and go to Calendar.
      3. Click New event button and change the event type to Course (if not set already)
      4. Click on the down-arrow inside the course drop-down.
      5. Make sure you only see the course you have been enrolled in.
      6. Logout.
      7. Log in as admin.
      8. Go back to Site administration > Appearance > Calendar and disable the calendar_adminseesall setting.
      9. Logout.
      10. Log in as t1 and go to Calendar.
      11. Click New event button and change the event type to Course (if not set already).
      12. Click on the down-arrow inside the course drop-down.
      13. Make sure you only see the course you have been enrolled in.
      Testing scenario 3: Student
      1. As admin, enrol another user (s1) as student in one of the 3 courses.
      2. Go back to Site administration > Appearance > Calendar and enable the calendar_adminseesall setting.
      3. Go to that course, turn editing mode on and add the Calendar block.
      4. Log in as s1 and go to Calendar.
      5. You should only see User event type, there shouldn't be a selector to choose the event type.
      6. Go to the course you are enrolled in and click in the month name (July 2019) to go to course calendar.
      7. Click New event button.
      8. You should only see User event type, there shouldn't be a selector to choose the event type.
      Show
      Testing scenario 1: Admin Log in as admin. Go to Site administration > Appearance > Calendar and make sure calendar_adminseesall setting is disabled . Create 3 courses (or use an existing) Enrol yourself (admin) in only 2 of those 3 courses. Go to Calendar and click New event button In the event form, select Course event type. Click in the course selector and then press (down) key to see all available courses. Make sure you just see the courses you are enrolled in. Now, go back to Site administration > Appearance > Calendar and enable the calendar_adminseesall setting. Go to Calendar and click New event button. Select Course event type, click in the course selector and press (down) key. Make sure you see ALL the courses, not just the ones you are enrolled in. Testing scenario 2: Teacher As admin, enrol a user (t1) as teacher in one of those 3 courses. Log in as t1 and go to Calendar. Click New event button and change the event type to Course (if not set already) Click on the down-arrow inside the course drop-down. Make sure you only see the course you have been enrolled in. Logout. Log in as admin. Go back to Site administration > Appearance > Calendar and disable the calendar_adminseesall setting. Logout. Log in as t1 and go to Calendar. Click New event button and change the event type to Course (if not set already). Click on the down-arrow inside the course drop-down. Make sure you only see the course you have been enrolled in. Testing scenario 3: Student As admin, enrol another user (s1) as student in one of the 3 courses. Go back to Site administration > Appearance > Calendar and enable the calendar_adminseesall setting. Go to that course, turn editing mode on and add the Calendar block. Log in as s1 and go to Calendar. You should only see User event type, there shouldn't be a selector to choose the event type. Go to the course you are enrolled in and click in the month name (July 2019) to go to course calendar. Click New event button. You should only see User event type, there shouldn't be a selector to choose the event type.
    • Affected Branches:
      MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE
    • Pull from Repository:
    • Pull 3.6 Branch:
      MDL-65958-36-v3
    • Pull 3.7 Branch:
      MDL-65958-37-v3
    • Pull Master Branch:
      MDL-65958-master-v3
    • Sprint:
      Internationals - 3.8 Sprint 2

      Description

      I noticed this while implementing this feature for the mobile app. Looking at the code, all the courses are only displayed if you do NOT have the capability 'moodle/calendar:manageentries'. This seemed a bit weird to me, so I looked at the code and I saw this change:

      https://github.com/moodle/moodle/commit/687112af223293ab3ee108c07ab0eb4a636d5392#diff-d030dabf618dc41b07a8bab06a6a9fefR101

      Before the change, you could see all courses if you had the capability, but after the change the behaviour was changed to the opposite. I guess this was a mistake and it should be fixed.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  8/Jul/19

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours, 5 minutes
                  4h 5m