Skip to content

Commit

Permalink
Merge branch 'MDL-51720-master' of git://github.com/damyon/moodle
Browse files Browse the repository at this point in the history
stronk7 committed Nov 10, 2015
2 parents 13cad25 + 85d0696 commit d18a8d7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions mod/assign/gradingtable.php
Original file line number Diff line number Diff line change
@@ -402,8 +402,6 @@ public function __construct(assign $assignment,
foreach ($extrauserfields as $extrafield) {
$this->column_class($extrafield, $extrafield);
}
// We require at least one unique column for the sort.
$this->sortable(true, 'userid');
$this->no_sorting('recordid');
$this->no_sorting('finalgrade');
$this->no_sorting('userid');
@@ -1375,6 +1373,16 @@ public function can_view_all_grades() {
has_capability('moodle/grade:viewall', $context);
}

/**
* Always return a valid sort - even if the userid column is missing.
* @return array column name => SORT_... constant.
*/
public function get_sort_columns() {
$result = parent::get_sort_columns();
$result = array_merge($result, array('userid' => SORT_ASC));
return $result;
}

/**
* Override the table show_hide_link to not show for select column.
*

0 comments on commit d18a8d7

Please sign in to comment.