Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 3.9.2
-
Labels:
-
Testing Instructions:
-
Affected Branches:MOODLE_39_STABLE
-
Fixed Branches:MOODLE_310_STABLE, MOODLE_39_STABLE
-
Pull from Repository:
-
Pull 3.9 Branch:
MDL-69868-39 -
Pull 3.9 Diff URL:
-
Pull 3.10 Branch:
MDL-69868-310 -
Pull 3.10 Diff URL:
-
Pull 3.11 Branch:
MDL-69868-311 -
Pull 3.11 Diff URL:
-
Pull Master Branch:
MDL-69868-master -
Pull Master Diff URL:
-
Sprint:Moppies Kanban
Description
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