Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-18083 META: Gradebook improvements - Stage 1
  3. MDL-16687

Typo in grade/lib.php causes incorrect sorting

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.2
    • Fix Version/s: 1.9.5
    • Component/s: Gradebook
    • Labels:
      None
    • Database:
      Any
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      The following source (from HEAD as of 9/25/2008) contains a typo in line 105 where 'sortfield1' should be 'sortfield2':

      102 $ofields = ", u.$this->sortfield1 AS usrt1";
      103 $order = "usrt1 $this->sortorder1";
      104 if (!empty($this->sortfield2))

      { 105 $ofields .= ", u.$this->sortfield1 AS usrt2"; 106 $order .= ", usrt2 $this->sortorder2"; 107 }

      The SQL generated by this typo-affected code tries to sort by $this->sortfield1 twice and neglects $this->sortfield2. We didn't notice the problem until one of our instructors encountered it while exporting his gradebook.

      This is a one-character fix.

      Thanks,
      Philip Cali and Adam Zapletal

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/May/09