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

Userlist in course is not sortable when lastaccess field is hidden

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.3, 2.2, 2.3
    • 2.1.4, 2.2.1
    • Course
    • MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • MOODLE_21_STABLE, MOODLE_22_STABLE
    • MDL-30472-master
    • 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"

    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.

      Attachments

        Activity

          People

            ankit_frenz Ankit Agarwal
            abias Alexander Bias
            Jason Fowler Jason Fowler
            Aparup Banerjee Aparup Banerjee
            Rossiani Wijaya Rossiani Wijaya
            Amaia Anabitarte, Carlos Escobedo, Laurent David, Sabina Abellan, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              9/Jan/12