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

Some plugins do not check that context in delete_data_for_all_users_in_context() is correct context for them




      Method delete_data_for_all_users_in_context() from ALL providers is called when context expires. Some plugins have insufficient checks on contextlevel and some modules do not check that this is a module of the given type

      original description:

      I found two problems with LTI module:
      1. same as MDL-62427 has in forums - delete functions do not check that module type is 'lti' . You can expire old chat module and accidentally delete recent graded lti
      2. system context is added for all users and the manager always reports that there is something for lti module even when user definitely does not have anything

      So far we have -

      1. mod_lti
      2. mod_choice
      3. mod_assign export_user_data() and delete_data_for_user()
      4. mod_feedback export_user_data()
      5. mod_glossary export_user_data(), both delete functions
      6. mod_lesson export_user_data() partially
      7. mod_quiz - doesn't skip if module not found in delete_data_for_user - will cause php exception. Also doesn't check contextlevel
      8. mod_scorm export_user_data()
      9. mod_survey doesn't skip in delete_data_for_all_users_in_context(), not a big deal
      10. mod_wiki export_user_data()
      11. mod_workshop export_user_data()

      The following modules are ok:
      Book (null), chat, data, folder (null), forum (MDL-62427), imscp (null), label (null), page (null), resource (null), url (null)


          Issue Links



              • Votes:
                1 Vote for this issue
                5 Start watching this issue


                • Created:
                  Fix Release Date: