Merge pull request #11 from mattgunn/patch-1

Removing paging subset occuring before pagination is set
This commit is contained in:
Sean Harvey 2013-05-16 17:07:27 -07:00
commit 7119d5ac80

View File

@ -1418,11 +1418,7 @@ class MSSQLDatabase extends SS_Database {
$objects = array();
foreach ($result as $row) {
$current++;
// Select a subset for paging
if ($current >= $start && $current < $start + $pageLength) {
$objects[] = DataObject::get_by_id($row['Source'], $row['ID']);
}
$objects[] = DataObject::get_by_id($row['Source'], $row['ID']);
}
if(isset($objects)) $results = new ArrayList($objects);