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

Glossary module can leave orphan records behind

XMLWordPrintable

    • MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
    • MOODLE_34_STABLE, MOODLE_35_STABLE
    • MDL-62446-master
    • Hide

      Please refer to this document to get the testing scripts
      https://docs.moodle.org/dev/Privacy_API/Utilities

      1. Log in as admin.
      2. In a given course, enrol some students (s1, s2)
      3. Create a glossary and enable the following settings:
        • Under Entries, set Allow comments on entries to Yes
        • Under Ratings, set Aggregate type to Average of ratings (can be any type)
      4. Save and display.
      5. Log in as s1 and go to the glossary
      6. Add a new entry giving a concept easy to identify such: s1 entry
        • Add an attachment and a tag such "s1entrytag"
      7. Save changes
      8. Log in as s2 and repeat the last 3 steps.
      9. Log in as admin and go to that glossary.
      10. Create an entry.
      11. Add a rating to s1 and s2 entries.
      12. Add few comments on the entries.
      13. Now, using our privacy export testing script, update it to use s1 user id.
      14. Export user data and make sure it exports correctly your entries, tags, comments and ratings.
      15. Update the privacy export testing script, update it to use s2 user id.
      16. Export user data and make sure it exports correctly your entries, tags, comments and ratings.
      17. Now, using our privacy deletion testing script, update it to use s1 user id.
      18. Run the script, make sure s1 data (tags, comments, entries) have been deleted.
        • User 2 and admin data should not be deleted.
      19. Now, using our privacy deletion testing script (delete all users data one).
      20. Run the script, all user data (admin, s2) should also be deleted.
      Show
      Please refer to this document to get the testing scripts https://docs.moodle.org/dev/Privacy_API/Utilities Log in as admin. In a given course, enrol some students (s1, s2) Create a glossary and enable the following settings: Under Entries , set Allow comments on entries to Yes Under Ratings , set Aggregate type to Average of ratings (can be any type) Save and display. Log in as s1 and go to the glossary Add a new entry giving a concept easy to identify such: s1 entry Add an attachment and a tag such "s1entrytag" Save changes Log in as s2 and repeat the last 3 steps. Log in as admin and go to that glossary. Create an entry. Add a rating to s1 and s2 entries. Add few comments on the entries. Now, using our privacy export testing script, update it to use s1 user id. Export user data and make sure it exports correctly your entries, tags, comments and ratings. Update the privacy export testing script, update it to use s2 user id. Export user data and make sure it exports correctly your entries, tags, comments and ratings. Now, using our privacy deletion testing script, update it to use s1 user id. Run the script, make sure s1 data (tags, comments, entries) have been deleted. User 2 and admin data should not be deleted. Now, using our privacy deletion testing script (delete all users data one). Run the script, all user data (admin, s2) should also be deleted.
    • GDPR Followup Sprint 1

      When deleting the data for all users in the privacy provider, the categories and aliases for the entries won't be deleted. The foreach will loop over an empty list, thus leaving the records behind.

      // Simplified code from line 250 onwards.
      $DB->delete_records('glossary_entries', ['glossaryid' => $instanceid]);
      ...
      $entries = $DB->get_records('glossary_entries', ['glossaryid' => $instanceid]);
      foreach ($entries as $entry) {
          $DB->delete_records('glossary_entries_categories', ['entryid' => $entry->id]);
          $DB->delete_records('glossary_alias', ['entryid' => $entry->id]);
      }
      

      It seems that the tests do not check the deletion of those related records.

      Also to consider: using get_in_or_equal instead of foreach.

            lameze Simey Lameze
            fred Frédéric Massart
            Adrian Greeve Adrian Greeve
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Victor Déniz Falcón Victor Déniz Falcón
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.