MDL-83263 grade: Handle undefined array key on grade override revert

This commit is contained in:
Mihail Geshoski 2024-09-25 17:03:28 +08:00
parent 97c2beae70
commit 8ea2f036c1

View File

@ -168,7 +168,7 @@ if ($mform->is_cancelled()) {
if (isset($data->feedback) && is_array($data->feedback)) {
$data->feedbackformat = $data->feedback['format'];
$data->feedback = $data->feedback['text'];
$data->feedback = $data->feedback['text'] ?? null;
}
$old_grade_grade = new grade_grade(array('userid'=>$data->userid, 'itemid'=>$grade_item->id), true); //might not exist yet