mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
MDL-53453 cbe: False negative on MySQL due to random ordering
This commit is contained in:
parent
96c2b8477f
commit
fd7e6bfd4a
@ -4020,17 +4020,18 @@ class api {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$select = 'usercompetencyid = :usercompetencyid';
|
||||||
|
$params = array('usercompetencyid' => $usercompetency->get_id());
|
||||||
if ($plancompleted) {
|
if ($plancompleted) {
|
||||||
$select = 'usercompetencyid = :usercompetencyid AND timecreated <= :timecompeleted';
|
$select .= ' AND timecreated <= :timecompleted';
|
||||||
$params = array('usercompetencyid' => $usercompetency->get_id(), 'timecompeleted' => $plan->get_timemodified());
|
$params['timecompleted'] = $plan->get_timemodified();
|
||||||
$orderby = $sort . ' ' . $order;
|
|
||||||
$evidences = evidence::get_records_select($select, $params, $orderby, '*', $skip, $limit);
|
|
||||||
} else {
|
|
||||||
$params = array('usercompetencyid' => $usercompetency->get_id());
|
|
||||||
$evidences = evidence::get_records($params, $sort, $order, $skip, $limit);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $evidences;
|
$orderby = $sort . ' ' . $order;
|
||||||
|
$orderby .= !empty($orderby) ? ', id DESC' : 'id DESC'; // Prevent random ordering.
|
||||||
|
|
||||||
|
$evidence = evidence::get_records_select($select, $params, $orderby, '*', $skip, $limit);
|
||||||
|
return $evidence;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user