mirror of
https://github.com/silverstripe/silverstripe-mssql
synced 2024-10-22 06:05:53 +00:00
BUG Fixing problem where duplicate items appear on pages
Reverts 13cdb07539d560f509605b836390de3317401fb4 and instead calls setLimitItems(false) on PaginatedList to tell it we've already limited the number of items to be shown.
This commit is contained in:
parent
1560bad60c
commit
01d376f501
@ -1418,7 +1418,11 @@ class MSSQLDatabase extends SS_Database {
|
||||
$objects = array();
|
||||
foreach ($result as $row) {
|
||||
$current++;
|
||||
$objects[] = DataObject::get_by_id($row['Source'], $row['ID']);
|
||||
|
||||
// Select a subset for paging
|
||||
if ($current >= $start && $current < $start + $pageLength) {
|
||||
$objects[] = DataObject::get_by_id($row['Source'], $row['ID']);
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($objects)) $results = new ArrayList($objects);
|
||||
@ -1427,6 +1431,10 @@ class MSSQLDatabase extends SS_Database {
|
||||
$list->setPageStart($start);
|
||||
$list->setPageLength($pageLength);
|
||||
$list->setTotalItems($current+1);
|
||||
|
||||
// The list has already been limited by the query above
|
||||
$list->setLimitItems(false);
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user