Merged bug 4351 fix from stable
This commit is contained in:
+3
-1
@@ -610,12 +610,14 @@ function get_record($table, $field1, $value1, $field2='', $value2='', $field3=''
|
||||
* @param string $sql The SQL string you wish to be executed.
|
||||
* @return Found record as object. False if not found or error
|
||||
*/
|
||||
function get_record_sql($sql, $expectmultiple=false) {
|
||||
function get_record_sql($sql, $expectmultiple=false, $nolimit=false) {
|
||||
|
||||
global $db, $CFG;
|
||||
|
||||
if (isset($CFG->debug) && $CFG->debug > 7 && !$expectmultiple) { // Debugging mode - don't use limit
|
||||
$limit = '';
|
||||
} else if ($nolimit) {
|
||||
$limit = '';
|
||||
} else {
|
||||
$limit = ' LIMIT 1'; // Workaround - limit to one record
|
||||
}
|
||||
|
||||
@@ -717,9 +717,10 @@ class assignment_base {
|
||||
$limit = sql_paging_limit($offset+1, 1);
|
||||
|
||||
$nextid = 0;
|
||||
if (($auser = get_record_sql($select.$sql.$sort.$limit)) !== false) {
|
||||
if (($auser = get_record_sql($select.$sql.$sort.$limit, false, true)) !== false) {
|
||||
$nextid = $auser->id;
|
||||
}
|
||||
|
||||
print_header(get_string('feedback', 'assignment').':'.fullname($user, true).':'.format_string($this->assignment->name));
|
||||
|
||||
///SOme javascript to help with setting up >.>
|
||||
|
||||
Reference in New Issue
Block a user