Skip to content

Commit

Permalink
CONTRIB-6873 teacher view: adjust paging
Browse files Browse the repository at this point in the history
Prevent the paging offset from being beyond the list's end
  • Loading branch information
bostelm committed Apr 28, 2017
1 parent d447869 commit 68933ab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions teacherview.php
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,9 @@ function scheduler_print_schedulebox(scheduler_instance $scheduler, $studentid,
$offset = 0;
}
}
if ($offset * $pagesize >= $sqlcount && $sqlcount > 0) {
$offset = floor(($sqlcount-1) / $pagesize);
}

$slots = $scheduler->get_slots_for_teacher($teacherid, $currentgroup, $offset * $pagesize, $pagesize);

Expand Down

0 comments on commit 68933ab

Please sign in to comment.