mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-23 19:50:40 -05:00
(fix)wrong page array index value passed in during Group View pagination
The index value should be -1 since arrays start from 0. Otherwise, n+1-th page will be displayed when mouse clicked n-th page.
This commit is contained in:
@@ -661,8 +661,8 @@ class TorrentController extends Controller
|
||||
|
||||
$hungry = array_chunk($prelauncher, $qty);
|
||||
$fed = [];
|
||||
if (is_array($hungry) && array_key_exists($page, $hungry)) {
|
||||
$fed = $hungry[$page];
|
||||
if (is_array($hungry) && array_key_exists($page-1, $hungry)) {
|
||||
$fed = $hungry[$page-1];
|
||||
}
|
||||
$totals = [];
|
||||
$counts = [];
|
||||
@@ -725,8 +725,8 @@ class TorrentController extends Controller
|
||||
|
||||
$hungry = array_chunk($prelauncher, $qty);
|
||||
$fed = [];
|
||||
if (is_array($hungry) && array_key_exists($page, $hungry)) {
|
||||
$fed = $hungry[$page];
|
||||
if (is_array($hungry) && array_key_exists($page-1, $hungry)) {
|
||||
$fed = $hungry[$page-1];
|
||||
}
|
||||
$torrents = Torrent::with(['user', 'category'])->withCount(['thanks', 'comments'])->whereIn('id', $fed)->orderBy($sorting, $order)->get();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user