-
Bug
-
Resolution: Fixed
-
Blocker
-
3.4.5, 3.5.2, 3.6
-
MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
-
MOODLE_34_STABLE, MOODLE_35_STABLE
-
MDL-63867-master -
-
GDPR Followup Sprint 1
This is a must fix for minor releases.
Adhoc task failed: tool_dataprivacy\task\initiate_data_request_task,Coding error detected, it must be fixed by a programmer: Something went wrong, system defaults should be set and we should already have a value.
|
Backtrace:
|
* line 273 of /admin/tool/dataprivacy/classes/expired_contexts_manager.php: call to tool_dataprivacy\data_registry::get_effective_contextlevel_value()
|
* line 211 of /admin/tool/dataprivacy/classes/expired_contexts_manager.php: call to tool_dataprivacy\expired_contexts_manager::get_nested_expiry_info_from_sql()
|
* line 819 of /admin/tool/dataprivacy/classes/expired_contexts_manager.php: call to tool_dataprivacy\expired_contexts_manager::get_nested_expiry_info_for_courses()
|
* line 809 of /admin/tool/dataprivacy/classes/expired_contexts_manager.php: call to tool_dataprivacy\expired_contexts_manager::is_course_context_expired()
|
* line 872 of /admin/tool/dataprivacy/classes/expired_contexts_manager.php: call to tool_dataprivacy\expired_contexts_manager::is_course_expired()
|
* line 897 of /admin/tool/dataprivacy/classes/expired_contexts_manager.php: call to tool_dataprivacy\expired_contexts_manager::are_user_context_dependencies_expired()
|
* line 1004 of /admin/tool/dataprivacy/classes/api.php: call to tool_dataprivacy\expired_contexts_manager::is_context_expired_or_unprotected_for_user()
|
* line 103 of /admin/tool/dataprivacy/classes/task/initiate_data_request_task.php: call to tool_dataprivacy\api::add_request_contexts_with_status()
|
* line 185 of /lib/cronlib.php: call to tool_dataprivacy\task\initiate_data_request_task->execute()
|
* line 113 of /admin/tool/task/cli/adhoc_task.php: call to cron_run_inner_adhoc_task()
|
The easiest solution is to add a new "is_system_purpose_defined" function. Essentially, the inverse of:
$classname = \context_helper::get_class_for_level($record->contextlevel);
|
list($purposevar, $categoryvar) = data_registry::var_names_from_context($classname);
|
set_config($purposevar, $record->purposeid, 'tool_dataprivacy');
|
set_config($categoryvar, $record->categoryid, 'tool_dataprivacy');
|
Following that we call the function in expired_contexts_manager::is_context_expired_or_unprotected_for_user() and have the function return true if the site is not configured (equivalent to meaning allow deletion of anything if GDPR is not configured).
We may need to hook into other places too.
To reproduce this issue, setup a new site, request a user deletion, and run the adhoc task.