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

    • Sub-task
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.9.2
    • 1.9.5
    • Gradebook
    • None
    • Any
    • MOODLE_19_STABLE
    • 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

            skodak Petr Skoda
            pcali1 Philip Cali
            Nicolas Connault Nicolas Connault
            Adrian Greeve, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              13/May/09