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

Deleting a group with group messaging enabled can leave orphaned favourites

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Master and 3.6 Testing (test both, patch differs!)

      Setup

      1. Create a fresh instance, but don't install.
      2. When testing master, checkout 9d4f4f0051290d0dc and install. When checking 3.6, checkout dcaa783741fe and install.
      3. Create a course with 2 students
      4. Create a group and place both students in it
      5. Enable group messaging for the group
      6. As student 1, log in and star the group conversation
      7. Do the same for student 2
      8. Check the database for the favourite records:

        SELECT * FROM mdl_favourite WHERE component = 'core_message' and itemtype = 'message_conversations';
        

        There should be 2 records. Record the ids somewhere for BOTH master and 36!

      9. Now, as the admin, delete the course.
      10. Again, check the favourites records are present:

        SELECT * FROM mdl_favourite WHERE component = 'core_message' and itemtype = 'message_conversations';
        

        There should be 2 records (these are the stale records).

      Now, upgrade.

      1. Now, checkout either master or MOODLE_36_STABLE (depending on which version you're currently testing) and upgrade.

        SELECT * FROM mdl_favourite WHERE id in (xxx);
        

        Replacing the xxx with the list of ids you stored earlier, eg. '1,2'.
        Verify that there are 0 records returned now. The stale records have been cleaned up.

      2. Create a course with 2 students
      3. Create a group and place both students in it
      4. Enable group messaging for the group
      5. As student 1, log in and star the group conversation
      6. Do the same for student 2
      7. Check the database for the favourite records for both users:

        SELECT * FROM mdl_favourite WHERE component = 'core_message' and itemtype = 'message_conversations' and userid = X;

        SELECT * FROM mdl_favourite WHERE component = 'core_message' and itemtype = 'message_conversations' and userid = Y;
        

        Replacing 'X' and 'Y' with the ids of each user, respectively.
        On 36, verify there is 1 record for each student.
        On master, verify there are 2 records for each student (master has self conversations automatically starred for the user)

      8. Now, as the admin, delete the course.
      9. Again, check the favourites records are present:

        SELECT * FROM mdl_favourite WHERE component = 'core_message' and itemtype = 'message_conversations' and userid = X;

        SELECT * FROM mdl_favourite WHERE component = 'core_message' and itemtype = 'message_conversations' and userid = Y;
        

        Replacing 'X' and 'Y' with the ids of each user, respectively.
        On 36, verify there are 0 records for each student. These were removed on course deletion.
        On master, verify there is 1 records for each student (master has self conversations automatically starred for the user)

      Show
      Master and 3.6 Testing (test both, patch differs!) Setup Create a fresh instance, but don't install. When testing master, checkout 9d4f4f0051290d0dc and install. When checking 3.6, checkout dcaa783741fe and install. Create a course with 2 students Create a group and place both students in it Enable group messaging for the group As student 1, log in and star the group conversation Do the same for student 2 Check the database for the favourite records: SELECT * FROM mdl_favourite WHERE component = 'core_message' and itemtype = 'message_conversations'; There should be 2 records.  Record the ids somewhere for BOTH master and 36! Now, as the admin, delete the course. Again, check the favourites records are present: SELECT * FROM mdl_favourite WHERE component = 'core_message' and itemtype = 'message_conversations'; There should be 2 records (these are the stale records). Now, upgrade. Now, checkout either master or MOODLE_36_STABLE (depending on which version you're currently testing) and upgrade. SELECT * FROM mdl_favourite WHERE id in (xxx); Replacing the xxx with the list of ids you stored earlier, eg. '1,2'. Verify that there are 0 records returned now. The stale records have been cleaned up. Create a course with 2 students Create a group and place both students in it Enable group messaging for the group As student 1, log in and star the group conversation Do the same for student 2 Check the database for the favourite records for both users: SELECT * FROM mdl_favourite WHERE component = 'core_message' and itemtype = 'message_conversations' and userid = X; SELECT * FROM mdl_favourite WHERE component = 'core_message' and itemtype = 'message_conversations' and userid = Y; Replacing 'X' and 'Y' with the ids of each user, respectively. On 36, verify there is 1 record for each student. On master,  verify there are 2 records for each student (master has self conversations automatically starred for the user) Now, as the admin, delete the course. Again, check the favourites records are present: SELECT * FROM mdl_favourite WHERE component = 'core_message' and itemtype = 'message_conversations' and userid = X; SELECT * FROM mdl_favourite WHERE component = 'core_message' and itemtype = 'message_conversations' and userid = Y; Replacing 'X' and 'Y' with the ids of each user, respectively. On 36, verify there are 0 records for each student. These were removed on course deletion. On master,  verify there is 1 records for each student (master has self conversations automatically starred for the user)
    • Affected Branches:
      MOODLE_36_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE
    • Pull from Repository:
    • Pull 3.6 Branch:
    • Pull Master Branch:
      MDL-65313-master

      Description

      Related to MDL-64568; if you have a group conversation that has been favourited, then delete the group associated with it, the favourite will still be present in the favourite table. Deleting the course also does not clean it up.

        Attachments

        1. MDL-65313_36.jpg
          54 kB
          Anna Carissa Sadia
        2. MDL-65313_master.jpg
          44 kB
          Anna Carissa Sadia

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/May/19

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 1 hour, 17 minutes
                  1d 1h 17m