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

'get_course_students' in 'deprecatedlib.php' is not returning user correctly

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.3
    • Fix Version/s: 1.9.4
    • Component/s: Libraries
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      The 'get_course_students' function in 'deprecatedlib.php' is returning records by 'LEFT JOINING' the 'user_lastaccess' table on the 'userid' only. This has the effect of returning one record for each occurrence of a user in any course, and not just the one requested. The effect is not noticed except on paged output, because the records are indexed by the userid. On pages output however, the page counts are all off.

      The 'LEFT JOIN' needs to include the courseid as a condition. It needs to be part of the join in case there isn't a lastaccess record for a valid user.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  28/Jan/09