-
Bug
-
Resolution: Fixed
-
Minor
-
3.5.3, 3.6.2, 3.7
-
MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
-
MOODLE_35_STABLE, MOODLE_36_STABLE
-
MDL-63975-master -
Environment:
Moodle 3.5.2+ (Build: 20181031)
mod_assign 2018051400
mariadb 5.5.56 2
php 7.1.2
CentOS Linux release 7.5.1804
Apache / 2.4.6
Reproduction of the error:
1. the teacher creates an assignment via mod_assign
2. The student submits an assignment and validates it for evaluation
3. The teacher authorizes a new attempt for the student WITHOUT having noted it on his first attempt
4. the student tries to go back to the assignement, the error appears
Fault:
Exception: Argument 1 passed to core_renderer :: user_picture () must be an instance of stdClass, string given, called in [dirroot] /mod/assign/renderer.php on line 1106.
Code causing the error:
In [dirroot] /mod/assign/renderer.php on line +/- 1106:
$ cell2 = new html_table_cell ($ this-> output-> user_picture ($ grade-> grader). |
$ this-> output-> spacer (array ('width' => 30)). fullname ($ grade-> grader)); |
Assumption:
$ grade-> grader is null, empty or different from what is expected because the previous assignment was not rated then there is no grader
Patch:
Removing the call to user_picture makes the problem no longer appears. It's a dirty patch because I'm not able to measure the other implications of the problem:
In [dirroot] /mod/assign/renderer.php on line +/- 1106:
// Graded by.
|
$ cell1 = new html_table_cell ($ gradedbystr); |
// $ cell2 = new html_table_cell ($ this-> output-> user_picture ($ grade-> grader).
|
// $ this-> output-> spacer (array ('width' => 30)). fullname ($ grade-> grader));
|
// Nicolas 12/11/18: patch to work around a programming error
|
$ cell2 = new html_table_cell ($ this-> output-> spacer (array ('width' => 30)). fullname ($ grade-> grader)); |
- has been marked as being related by
-
MDL-64507 Previous attempts expose grader info when hide grader identity is set.
- Closed