-
Bug
-
Resolution: Fixed
-
Minor
-
3.3.5, 3.4.2, 3.5, 3.6
-
MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
-
MOODLE_34_STABLE, MOODLE_35_STABLE
-
MDL-62446-master -
-
GDPR Followup Sprint 1
When deleting the data for all users in the privacy provider, the categories and aliases for the entries won't be deleted. The foreach will loop over an empty list, thus leaving the records behind.
// Simplified code from line 250 onwards.
|
$DB->delete_records('glossary_entries', ['glossaryid' => $instanceid]);
|
...
|
$entries = $DB->get_records('glossary_entries', ['glossaryid' => $instanceid]);
|
foreach ($entries as $entry) {
|
$DB->delete_records('glossary_entries_categories', ['entryid' => $entry->id]);
|
$DB->delete_records('glossary_alias', ['entryid' => $entry->id]);
|
}
|
It seems that the tests do not check the deletion of those related records.
Also to consider: using get_in_or_equal instead of foreach.