Affects Version/s: 2.3.3
ShowActivate feedback module at the admin settings Add a feedback instance to a course. Make sure the course has the Recent Activity block. Complete the feedback activity. It isn't important what user you use. In the recent activity block, click "Full report of recent activity." No error raises
- Activate feedback module at the admin settings
- Add a feedback instance to a course.
- Make sure the course has the Recent Activity block.
- Complete the feedback activity. It isn't important what user you use.
- In the recent activity block, click "Full report of recent activity."
- No error raises
Fixed Branches:MOODLE_23_STABLE, MOODLE_24_STABLE
Pull from Repository:
Pull Master Branch:
Pull Master Diff URL:
After a student submits a Feedback activity, it causes a coding error in the Recent Activity block.
Coding error detected, it must be fixed by a programmer: User id is required when printing user avatar image.
More information about this error
Error code: codingerror
line 186 of /lib/outputcomponents.php: coding_exception thrown
line 1897 of /lib/outputrenderers.php: call to user_picture->__construct()
line 487 of /mod/feedback/lib.php: call to core_renderer->user_picture()
line 263 of /course/recent.php: call to feedback_print_recent_mod_activity()
Steps to reproduce:
1. Add a feedback activity to a course.
2. Make sure the course has the Recent Activity block.
3. Complete the feedback activity. (Normally a student does this, but it breaks as admin too)
4. In the recent activity block, click "Full report of recent activity."
5. Receive error.
We have used these steps to reproduce this on a pure Moodle 2.3.3 site with no non-standard plugins, themes, or customizations.
feedback_print_recent_mod_activity() calls user_picture() to display the user's avatar. user_picture() expects the user object to have an "id" field but its id field is called "userid" instead.
Because this is causing a critical problem with a plugin for many of our clients, we are implementing a quick fix at the top of feedback_print_recent_mod_activity():
Anyone who needs a quick fix may feel free to use this but I'm not sure if this is the best way to fix it permanently.