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

Incorrect arguments passed

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 3.4
    • None
    • Privacy
    • None

    Description

      I've been trying to run the data deletion processes, have a number of times come across an issue with the wrong type of context being passed and conflicting with the defined signature on functions.

      Here is the dump from one such case when running the Delete expired contexts task via the web UI on 3.4

      Execute scheduled task: Delete expired contexts (tool_dataprivacy\task\delete_expired_contexts)
      ... started 14:29:21. Current memory use 10.6MB.
      object(context_module)#5969 (5) {
        ["_id":protected]=>
        int(1397)
        ["_contextlevel":protected]=>
        int(70)
        ["_instanceid":protected]=>
        string(3) "330"
        ["_path":protected]=>
        string(14) "/1/3/1367/1397"
        ["_depth":protected]=>
        string(1) "4"
      }
      object(context_module)#19 (5) {
        ["_id":protected]=>
        int(1398)
        ["_contextlevel":protected]=>
        int(70)
        ["_instanceid":protected]=>
        string(3) "331"
        ["_path":protected]=>
        string(14) "/1/3/1367/1398"
        ["_depth":protected]=>
        string(1) "4"
      }
      object(context_module)#17 (5) {
        ["_id":protected]=>
        int(1411)
        ["_contextlevel":protected]=>
        int(70)
        ["_instanceid":protected]=>
        string(3) "334"
        ["_path":protected]=>
        string(14) "/1/3/1367/1411"
        ["_depth":protected]=>
        string(1) "4"
      }
      object(context_module)#6007 (5) {
        ["_id":protected]=>
        int(1434)
        ["_contextlevel":protected]=>
        int(70)
        ["_instanceid":protected]=>
        string(3) "347"
        ["_path":protected]=>
        string(14) "/1/3/1367/1434"
        ["_depth":protected]=>
        string(1) "4"
      }
      object(context_module)#6008 (5) {
        ["_id":protected]=>
        int(1466)
        ["_contextlevel":protected]=>
        int(70)
        ["_instanceid":protected]=>
        string(3) "367"
        ["_path":protected]=>
        string(14) "/1/3/1367/1466"
        ["_depth":protected]=>
        string(1) "4"
      }
      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_block given, called in [dirroot]/privacy/classes/local/request/helper.php on line 95
       
      More information about this error
       
      Debug info: 
      Error code: generalexceptionmessage
      Stack trace: 
      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 103 of /admin/tool/dataprivacy/classes/expired_contexts_manager.php: call to core_privacy\manager->delete_data_for_all_users_in_context()
      line 59 of /admin/tool/dataprivacy/classes/task/delete_expired_contexts.php: call to tool_dataprivacy\expired_contexts_manager->delete()
      line 104 of /lib/cronlib.php: call to tool_dataprivacy\task\delete_expired_contexts->execute()
      line 292 of /lib/cronlib.php: call to cron_run_inner_scheduled_task()
      line 91 of /admin/tool/task/schedule_task.php: call to cron_run_single_task()

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mhughes2k Michael Hughes
              Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: