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

Orphaned users calendar subscriptions

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Test 1

      1. Log in as s1 and go to Calendar.
      2. Click Manage Subscription button.
      3. Add a new subscription using this ICAL url:

        https://calendar.google.com/calendar/ical/en.usa%23holiday%40group.v.calendar.google.com/public/basic.ics
        

      4. Repeat above steps, with s2 user.
      5. Log in as admin and go to Site administration > Users > Accounts > Browse list of users.
      6. Find s1 user hover over the name link and make note of the id (should be 3 if you are using MDK).
      7. Open the database and get the event_subscriptions for the user:

        SELECT * FROM mdl_event_subscriptions WHERE user = YOUR_USERID;

      8. Now on the Moodle UI delete s1 user.
      9. Run the query from step 8 again and verify there are no results.

      Test 2

      For this test you need to create an instance based on the last weekly, in order to test upgrading.

      1. Create, but DO NOT INSTALL, a new instance of integration (master, 37, 36)
      2. Now, checkout the last weekly:
        • master:

          git checkout 310d6901f9260ad
          

        • 37:

          git checkout f3c2624fbc4
          

        • 36:

          git checkout 2baf9a81d81
          

      3. Install the site.
      4. Log in as admin.
      5. Create a new user (let's say s3), make note of the userid.
      6. Log in as that user and go to Calendar > Manage subscriptions.
      7. Add a new subscription using this ICAL url:

        https://calendar.google.com/calendar/ical/en.usa%23holiday%40group.v.calendar.google.com/public/basic.ics

      8. Open the database editor and delete that user manually from mdl_user table.

        DELETE FROM mdl_user where id = X
        

        Where X is the ID you took note.

      1. Now checkout the current head::
        • master:

          git checkout master

        • 37:

          git checkout MOODLE_37_STABLE

        • 36:

          git checkout MOODLE_36_STABLE

      2. Run the upgrade
      3. Look mdl_event_subscriptions table and make sure there are no subscriptions for that user ID.

        SELECT * FROM mdl_event_subscriptions where userid = X
        

      Show
      Test 1 Log in as s1 and go to Calendar. Click Manage Subscription button. Add a new subscription using this ICAL url: https://calendar.google.com/calendar/ical/en.usa%23holiday%40group.v.calendar.google.com/public/basic.ics Repeat above steps, with s2 user. Log in as admin and go to Site administration > Users > Accounts > Browse list of users. Find s1 user hover over the name link and make note of the id (should be 3 if you are using MDK). Open the database and get the event_subscriptions for the user: SELECT * FROM mdl_event_subscriptions WHERE user = YOUR_USERID; Now on the Moodle UI delete s1 user. Run the query from step 8 again and  verify there are no results. Test 2 For this test you need to create an instance based on the last weekly, in order to test upgrading. Create, but DO NOT INSTALL, a new instance of integration (master, 37, 36) Now, checkout the last weekly: master: git checkout 310d6901f9260ad 37: git checkout f3c2624fbc4 36: git checkout 2baf9a81d81 Install the site. Log in as admin. Create a new user (let's say s3), make note of the userid. Log in as that user and go to Calendar > Manage subscriptions. Add a new subscription using this ICAL url: https://calendar.google.com/calendar/ical/en.usa%23holiday%40group.v.calendar.google.com/public/basic.ics Open the database editor and delete that user manually from mdl_user table. DELETE FROM mdl_user where id = X Where X is the ID you took note. Now checkout the current head:: master: git checkout master 37: git checkout MOODLE_37_STABLE 36: git checkout MOODLE_36_STABLE Run the upgrade Look mdl_event_subscriptions table and make sure there are no subscriptions for that user ID. SELECT * FROM mdl_event_subscriptions where userid = X
    • Affected Branches:
      MOODLE_38_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE
    • Pull from Repository:
    • Pull 3.6 Branch:
    • Pull 3.7 Branch:
    • Pull Master Branch:
      MDL-66551-master

      Description

      All users events and subscriptions are left orphaned in the event and event_subscription tables.

      That created a problem, because moodle keeps updating those users subscriptions generating thousands of unnecessary logs that are actually orphaned (see discussion on MDL-56223 for full details on the log creation and backup problem).

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  9/Sep/19

                  Time Tracking

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