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

    Details

      Description

      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.

        Attachments

          Activity

            People

            Assignee:
            jacks92 Jayesh Anandani
            Reporter:
            smcguinness Stephen Mc Guinness (Enovation)
            Peer reviewer:
            Jason Fowler Jason Fowler
            Integrator:
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Tester:
            Ankit Agarwal Ankit Agarwal
            Participants:
            Component watchers:
            Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              8/Jul/13