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

Incorrect restrictions in helper delete/export when called from mod

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.3.3, 3.4.2, 3.5
    • Fix Version/s: 3.3.6, 3.4.3
    • Component/s: Privacy
    • Labels:

      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 !!!
      

      David Monllaó will hopefully be able to advise which plugin this breaks on for replication instructions.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  17/May/18

                  Time Tracking

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