Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StudentQuiz: improve upgrade steps with new function #814045 #499

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions backup/moodle2/restore_studentquiz_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,7 @@ protected function process_notification($data) {

if (json_decode($data->content) === null) {
// Older versions of StudentQuiz stored this data serialised. We no longer support that.
// Such data is not restored. At worse, this leads to some lost notifications for users
// who have chosen to receive a digest, but to people want notifications relating to restored data?
return;
$data = json_encode(unserialize_object($data->content));
}

$DB->insert_record('studentquiz_notification', $data);
Expand Down
2 changes: 1 addition & 1 deletion db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -1739,7 +1739,7 @@ function xmldb_studentquiz_upgrade($oldversion) {
$count++;

$DB->set_field('studentquiz_notification',
'content', json_encode(unserialize($notification->content)),
'content', json_encode(unserialize_object($notification->content)),
['id' => $notification->id]);
}
$progressbar->update($count, $total, "Update the state for question - {$count}/{$total} - DONE!");
Expand Down
Loading