Skip to content

Commit

Permalink
MDL-46322 database: alias sort fields to avoid ambiguous naming
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 authored and danpoltawski committed Jun 13, 2017
1 parent 192a355 commit 9bcb6e1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion mod/assign/gradingtable.php
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ public function col_allocatedmarker(stdClass $row) {
static $markers = null;
static $markerlist = array();
if ($markers === null) {
list($sort, $params) = users_order_by_sql();
list($sort, $params) = users_order_by_sql('u');
// Only enrolled users could be assigned as potential markers.
$markers = get_enrolled_users($this->assignment->get_context(), 'mod/assign:grade', 0, 'u.*', $sort);
$markerlist[0] = get_string('choosemarker', 'assign');
Expand Down
10 changes: 5 additions & 5 deletions mod/assign/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -4017,7 +4017,7 @@ protected function view_grading_table() {
// Get markers to use in drop lists.
$markingallocationoptions = array();
if ($markingallocation) {
list($sort, $params) = users_order_by_sql();
list($sort, $params) = users_order_by_sql('u');
// Only enrolled users could be assigned as potential markers.
$markers = get_enrolled_users($this->context, 'mod/assign:grade', 0, 'u.*', $sort);
$markingallocationoptions[''] = get_string('filternone', 'assign');
Expand Down Expand Up @@ -4645,7 +4645,7 @@ public function view_batch_markingallocation($mform) {
'usershtml' => $usershtml,
);

list($sort, $params) = users_order_by_sql();
list($sort, $params) = users_order_by_sql('u');
// Only enrolled users could be assigned as potential markers.
$markers = get_enrolled_users($this->get_context(), 'mod/assign:grade', 0, 'u.*', $sort);
$markerlist = array();
Expand Down Expand Up @@ -6534,7 +6534,7 @@ protected function process_save_grading_options() {
if ($markingallocation) {
$markingallocationoptions[''] = get_string('filternone', 'assign');
$markingallocationoptions[ASSIGN_MARKER_FILTER_NO_MARKER] = get_string('markerfilternomarker', 'assign');
list($sort, $params) = users_order_by_sql();
list($sort, $params) = users_order_by_sql('u');
// Only enrolled users could be assigned as potential markers.
$markers = get_enrolled_users($this->context, 'mod/assign:grade', 0, 'u.*', $sort);
foreach ($markers as $marker) {
Expand Down Expand Up @@ -7170,7 +7170,7 @@ public function add_grade_form_elements(MoodleQuickForm $mform, stdClass $data,
$this->get_instance()->markingallocation &&
has_capability('mod/assign:manageallocations', $this->context)) {

list($sort, $params) = users_order_by_sql();
list($sort, $params) = users_order_by_sql('u');
// Only enrolled users could be assigned as potential markers.
$markers = get_enrolled_users($this->context, 'mod/assign:grade', 0, 'u.*', $sort);
$markerlist = array('' => get_string('choosemarker', 'assign'));
Expand Down Expand Up @@ -7591,7 +7591,7 @@ protected function process_set_batch_marking_allocation() {
'usershtml' => '' // initialise these parameters with real information.
);

list($sort, $params) = users_order_by_sql();
list($sort, $params) = users_order_by_sql('u');
// Only enrolled users could be assigned as potential markers.
$markers = get_enrolled_users($this->get_context(), 'mod/assign:grade', 0, 'u.*', $sort);
$markerlist = array();
Expand Down
2 changes: 1 addition & 1 deletion mod/assign/tests/markerallocation_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function test_markerusers() {
$oldusers = array($user1, $user2, $user4);
$newusers = array($user1, $user2);

list($sort, $params) = users_order_by_sql();
list($sort, $params) = users_order_by_sql('u');

// Old code, it must return 3 users: teacher1, teacher2 and Manger.
$oldmarkers = get_users_by_capability(context_course::instance($this->course->id), 'mod/assign:grade', '', $sort);
Expand Down

0 comments on commit 9bcb6e1

Please sign in to comment.