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

Stop loading parent record in repeat collection

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      No repeat test

      1. Log in as admin
      2. Go to the calendar
      3. Click the “new event” button
      4. Fill out the form and create an event
        • Make sure “Repeat this event” under the “show more” section isn’t checked (it’s not by default)
      5. CONFIRM that it creates a single event in the calendar
      6. Click the event in the main calendar (it should have now appeared after creating it above)
      7. CONFIRM that the summary modal shows up for the event
      8. Click the “edit” button
      9. Make changes to the event
      10. CONFIRM that you can save the changes to the event

      Repeat test

      1. Log in as admin
      2. Go to the calendar
      3. Click the “new event” button
      4. Fill out the form, click “show more” and make sure you check “Repeat this event” and have it repeat for a total of 3 weeks
      5. Save the event
      6. CONFIRM that it creates 3 events
      7. Click each one of the events in the main calendar
      8. CONFIRM that they open the summary modal for that event
      9. Edit each of the events
      10. CONFIRM that under “show more” there is a “Repeated events” section
      Show
      No repeat test Log in as admin Go to the calendar Click the “new event” button Fill out the form and create an event Make sure “Repeat this event” under the “show more” section isn’t checked (it’s not by default) CONFIRM that it creates a single event in the calendar Click the event in the main calendar (it should have now appeared after creating it above) CONFIRM that the summary modal shows up for the event Click the “edit” button Make changes to the event CONFIRM that you can save the changes to the event Repeat test Log in as admin Go to the calendar Click the “new event” button Fill out the form, click “show more” and make sure you check “Repeat this event” and have it repeat for a total of 3 weeks Save the event CONFIRM that it creates 3 events Click each one of the events in the main calendar CONFIRM that they open the summary modal for that event Edit each of the events CONFIRM that under “show more” there is a “Repeated events” section
    • Affected Branches:
      MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull Master Branch:
      MDL-60958-master

      Description

      The repeat collection constructor loads the parent record to check that the given id corresponds to a calendar event record however this results in an addition DB query for every event that is loaded, even if the event collection isn't used.

      We can just skip doing this query and trust the calling code to load the correct thing (especially since it's all packed into the factory anyway) and only load the parent record when it's required.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  19/Mar/18