MDL-65959 badge: Reset external_identifiers if backpack details modified

This commit is contained in:
Peter Dias 2020-09-21 14:28:28 +08:00
parent 8c9d3695e3
commit b0007a154c

View file

@ -69,7 +69,11 @@ if ($action == 'edit') {
} else if ($data = $form->get_data()) {
require_sesskey();
if (!empty($data->id)) {
badges_update_site_backpack($data->id, $data);
$id = $data->id;
badges_update_site_backpack($id, $data);
// Apart from the password, any change here would result in an error in other parts of the badge systems.
// In order to negate this, we restart any further mapping from scratch.
badges_external_delete_mappings($id);
} else {
badges_create_site_backpack($data);
}