-
Bug
-
Resolution: Fixed
-
Minor
-
1.9.10, 2.3.7, 2.4.3, 2.5, 2.6
-
MOODLE_19_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
-
MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
-
Easy
-
- Create a forum with a discussion.
- Verify that the user's full name displays correctly when viewing the discussion header.
I was modifying the fullname function when I noticed an inconsistency.
Current code:
$fullname = fullname($post, has_capability('moodle/site:viewfullnames', $modcontext));
Should be:
$fullname = fullname($postuser, has_capability('moodle/site:viewfullnames', $modcontext));
The post contains the user's name anyway so there is no real issue here unless you are in the fullname() function and expecting $user->id there to be the user's ID. The $user->id will be the post ID in this case.
Patch attached.