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

Userlist in course is not sortable when lastaccess field is hidden

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.3, 2.2, 2.3
    • Fix Version/s: 2.1.4, 2.2.1
    • Component/s: Course
    • Labels:
    • Testing Instructions:
      Hide
      1. Login as admin and from settings Hide "last access" filed (Search for setting hiddenuserfields)
      2. Make sure you have at-least 3-4 student users enrolled to the course
      3. goto something like http://YOURMOODLEURL/user/index.php?id=COURSEID
      4. make sure the result is sortable and is sorted by "First name ASC be default"
      Show
      Login as admin and from settings Hide "last access" filed (Search for setting hiddenuserfields) Make sure you have at-least 3-4 student users enrolled to the course goto something like http://YOURMOODLEURL/user/index.php?id=COURSEID make sure the result is sortable and is sorted by "First name ASC be default"
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull Master Branch:
      MDL-30472-master

      Description

      On http://YOURMOODLEURL/user/index.php?id=COURSEID there is a participants list of the selected course. By default, it is sorted by the lastaccess field. But when the lastaccess field is hidden to the user with the help of $CFG->hiddenuserfields, the list seems unsorted (or sorted by database ids).

      Furthermore, when lastaccess field is hidden, the user cannot sort the user list manually.

      We would like to suggest to improve this by replacing in /user/index.php

      if (!isset($hiddenfields['lastaccess'])) {
          $table->sortable(true, 'lastaccess', SORT_DESC);
      }

      with

      if (!isset($hiddenfields['lastaccess'])) {
          $table->sortable(true, 'lastaccess', SORT_DESC);
      }
      else {
          $table->sortable(true, 'lastname', SORT_ASC);
      }

      Thanks in advance.

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  9/Jan/12