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

Incorrect restrictions in helper delete/export when called from mod

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 3.3.3, 3.4.2, 3.5
    • 3.3.6, 3.4.3
    • Privacy

    Description

      A mod can export for non-mod contexts, but the helper does not cope with this.

      Bad combination of checking component name for mod, and a strict type hint of context_module on the functions they call.

      If I try to delete user contexts I get the same error I reported Yesterday 
       
      Error code: generalexceptionmessage
      * line 275 of /privacy/classes/local/request/helper.php: TypeError thrown
      * line 95 of /privacy/classes/local/request/helper.php: call to core_privacy\local\request\helper::delete_data_for_all_users_in_context_course_module()
      * line 267 of /privacy/classes/manager.php: call to core_privacy\local\request\helper::delete_data_for_all_users_in_context()
      * line 90 of /admin/tool/dataprivacy/classes/expired_contexts.php: call to core_privacy\manager->delete_data_for_all_users_in_context()
      * line 61 of /admin/tool/dataprivacy/classes/task/expired_retention_period.php: call to tool_dataprivacy\expired_contexts->delete()
      * line 156 of /admin/tool/task/cli/schedule_task.php: call to tool_dataprivacy\task\expired_retention_period->execute()
       
      !!! Exception - Argument 2 passed to core_privacy\local\request\helper::delete_data_for_all_users_in_context_course_module() must be an instance of context_module, instance of context_user given, called in [dirroot]/privacy/classes/local/request/helper.php on line 95 !!!
      

      dmonllao will hopefully be able to advise which plugin this breaks on for replication instructions.

      Attachments

        1. Capture.PNG
          190 kB
          Janelle Barcega
        2. MDL-61743-test.php
          0.8 kB
          David Monllaó

        Issue Links

          Activity

            People

              dmonllao David Monllaó
              dobedobedoh Andrew Lyons
              Jun Pataleta Jun Pataleta
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Janelle Barcega Janelle Barcega
              Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                17/May/18

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 10 minutes
                  10m