-
Bug
-
Resolution: Fixed
-
Blocker
-
3.9.2
-
MOODLE_39_STABLE
-
MOODLE_310_STABLE, MOODLE_39_STABLE
-
MDL-69868-master -
-
Moppies Kanban
Due to a bug in H5P, you may see a forum error of
Exception - Argument 2 passed to mod_forum\local\entities\author::__construct() must be of the type int, string given, called in [dirroot]/mod/forum/classes/local/factories/entity.php on line 184
|
The error is that the $user->picture field being passed to mod_forum\local\entities\author is a string instead of a int, which causes a TypeError to be thrown.
It took a while to trace down, but basically the attempts report in mod_h5pactivity modifies a local $user object, replacing the picture field with the rendered html picture field, so:
$user->picture == '1';
|
becomes
$user->picture == '<a href="https://moodle/user/view.php?id=123&course=345" class="d-inline-block aabtn"><img src="https://moodle/theme/image.php/boost/core/1601249177/u/f2" class="userpicture defaultuserpic" width="35" height="35" alt="Picture of Some Student" title="Picture of Some Student" /></a>';
|
To reproduce:
- As a student, make sure you have posted to a forum
- Complete a mod_h5pactivity attempt (or have an attempt already existing)
- Once you have an attempt, if you go to the activity, you will have 'View my attempts'
- Click 'View my attempts'
- Now navigate back to the forum discussion you have posted in previously
- See the error above