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

Batch load groups in calendar_set_filters

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 3.4
    • Fix Version/s: None
    • Component/s: Calendar
    • Labels:
    • Testing Instructions:
      Hide

      Test

      1. Log in as admin
      2. Create 2 courses, C1 and C2
      3. Create a user (s1) and enrol them as a student in C1 (but not C2)
      4. Hide course C2 (set “Course visibility” to “Hide” in course settings)
      5. For each of the courses, create a course event
        • View the course then click “Calendar” in the nav drawer which takes you to the course calendar to create the events
      6. Create 2 groups (g1 and g2) in C1 and add the user to g1
        • View the course and click the settings menu (little cog icon) and click “more”
        • In the users tab click “groups”
        • Create the groups
      7. Create a group event for each of the two groups
      8. View the course then click “Calendar” in the nav drawer which takes you to the course calendar to create the events
      9. Log in as s1
      10. View the calendar
      11. CONFIRM that you only see the course event for course C1. The event from C2 should not be visible because user s1 is not enrolled in that course
      12. CONFIRM that you only see the group event from group g1. The event from g2 should not be visible because the user s2 is not a member of g2
      13. Log in as admin
      14. Add the user s1 to group g2
      15. Log in as s1
      16. View the calendar
      17. CONFIRM that you can now see the event from g2 (as well as the one from g1)
      Show
      Test Log in as admin Create 2 courses, C1 and C2 Create a user (s1) and enrol them as a student in C1 (but not C2) Hide course C2 (set “Course visibility” to “Hide” in course settings) For each of the courses, create a course event View the course then click “Calendar” in the nav drawer which takes you to the course calendar to create the events Create 2 groups (g1 and g2) in C1 and add the user to g1 View the course and click the settings menu (little cog icon) and click “more” In the users tab click “groups” Create the groups Create a group event for each of the two groups View the course then click “Calendar” in the nav drawer which takes you to the course calendar to create the events Log in as s1 View the calendar CONFIRM that you only see the course event for course C1. The event from C2 should not be visible because user s1 is not enrolled in that course CONFIRM that you only see the group event from group g1. The event from g2 should not be visible because the user s2 is not a member of g2 Log in as admin Add the user s1 to group g2 Log in as s1 View the calendar CONFIRM that you can now see the event from g2 (as well as the one from g1)
    • Affected Branches:
      MOODLE_34_STABLE
    • Pull Master Branch:
      MDL-60961-master

      Description

      The calendar_set_filters function currently loads the groups for each course one course at a time in a loop. We should just load all of the groups in a single query to reduce the number of DB queries and improve the performance.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ryanwyllie Ryan Wyllie
              Reporter:
              ryanwyllie Ryan Wyllie
              Peer reviewer:
              Ankit Agarwal
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: