mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-22 10:08:31 -05:00
(Fix) search result renders empty element
Resubmitted the change again. When the $page posted back, it maybe 0. In order to use it for array index, we need to avoid negative value after deducting it by 1. That 0 case occurs when the searching takes place at default Group View loading. On the other hand, if the searching combined with a click on Paginator, the Paginator already posts a correct $page value instead of 0.
This commit is contained in:
@@ -661,6 +661,9 @@ class TorrentController extends Controller
|
||||
|
||||
$hungry = array_chunk($prelauncher, $qty);
|
||||
$fed = [];
|
||||
if ($page < 1) {
|
||||
$page = 1;
|
||||
}
|
||||
if (is_array($hungry) && array_key_exists($page - 1, $hungry)) {
|
||||
$fed = $hungry[$page - 1];
|
||||
}
|
||||
@@ -725,6 +728,9 @@ class TorrentController extends Controller
|
||||
|
||||
$hungry = array_chunk($prelauncher, $qty);
|
||||
$fed = [];
|
||||
if ($page < 1) {
|
||||
$page = 1;
|
||||
}
|
||||
if (is_array($hungry) && array_key_exists($page - 1, $hungry)) {
|
||||
$fed = $hungry[$page - 1];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user