Merged bug 4351 fix from stable

This commit is contained in:
moodler 2005-11-19 15:39:31 +00:00
parent ac17ef1162
commit 81532b92f2
2 changed files with 5 additions and 2 deletions

View File

@ -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
}

View File

@ -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 >.>