From 2030a3d87b23a18ee256ea54aa4bb244b50cdcb1 Mon Sep 17 00:00:00 2001 From: Jonathon Fowler Date: Wed, 23 Apr 2025 09:33:52 +1000 Subject: [PATCH] MDL-85474 assign: fix call to undefined 'view_error_page' method And while doing so, fix $notices parameters that ought to be call-by- reference to collect notices produced during calls to process_submit_other_for_grading() and process_submit_for_grading(). --- public/mod/assign/locallib.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/public/mod/assign/locallib.php b/public/mod/assign/locallib.php index c113e9ae59f..537b936399b 100644 --- a/public/mod/assign/locallib.php +++ b/public/mod/assign/locallib.php @@ -705,7 +705,7 @@ class assign { } else if ($action == 'viewbatchmarkingallocation') { $o .= $this->view_batch_markingallocation(); } else if ($action == 'viewsubmitforgradingerror') { - $o .= $this->view_error_page(get_string('submitforgrading', 'assign'), $notices); + $o .= $this->view_notices(get_string('submitforgrading', 'assign'), $notices); } else if ($action == 'fixrescalednullgrades') { $o .= $this->view_fix_rescaled_null_grades(); } else { @@ -7003,9 +7003,12 @@ class assign { /** * A students submission is submitted for grading by a teacher. * + * @param moodleform|null $mform If validation failed when submitting this form - this is the moodleform. + * It can be null. + * @param array $notices Receives error messages to display on an error condition. * @return bool */ - protected function process_submit_other_for_grading($mform, $notices) { + protected function process_submit_other_for_grading($mform, &$notices) { global $USER, $CFG; require_sesskey(); @@ -7026,9 +7029,10 @@ class assign { * * @param moodleform|null $mform If validation failed when submitting this form - this is the moodleform. * It can be null. + * @param array $notices Receives error messages to display on an error condition. * @return bool Return false if the validation fails. This affects which page is displayed next. */ - protected function process_submit_for_grading($mform, $notices) { + protected function process_submit_for_grading($mform, &$notices) { global $CFG; require_once($CFG->dirroot . '/mod/assign/submissionconfirmform.php');