Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-26120

Incorrect call to fullname() in mod/forum/lib.php; post object passed to fullname() instead of user object

XMLWordPrintable

      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.

            jacks92 Jayesh Anandani
            smcguinness Stephen Mc Guinness (Inactive)
            Jason Fowler Jason Fowler
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Ankit Agarwal Ankit Agarwal
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.