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

User profile 'Forum Posts' tab throws error.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.9
    • Fix Version/s: None
    • Component/s: Forum
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE

      Description

      If you click on the 'Forum Posts' tab for a user you get an error - 'Course id is incorrect'.

      I found the problem to be the incorrect usage of optional_param() in mod/forum/user.php

      namely, starting at line 7:
      $course = optional_param('course', PARAM_INT);
      $id = optional_param('id', PARAM_INT);
      $user = optional_param('user', PARAM_INT);

      This is passing PARAM_INT as the default return, instead of as the type.
      Should be:
      $course = optional_param('course', NULL, PARAM_INT);
      $id = optional_param('id', NULL, PARAM_INT);
      $user = optional_param('user', NULL, PARAM_INT);

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              poltawski Dan Poltawski
              Reporter:
              emerrill Eric Merrill
              Participants:
              Component watchers:
              Andrew Nicols, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: