Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 3.3.5, 3.4.2, 3.5, 3.6
-
Testing Instructions:
-
Affected Branches:MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
-
Fixed Branches:MOODLE_34_STABLE, MOODLE_35_STABLE
-
Epic Link:
-
Pull from Repository:
-
Pull Master Branch:
MDL-62446-master -
Pull Master Diff URL:
-
Sprint:GDPR Followup Sprint 1
Description
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.