From 00557cb3799ffd14a7d685fab5ec82ba18d71b34 Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Mon, 7 Jan 2019 14:38:38 -0500 Subject: [PATCH] Fix bug: don't throw error on page 1 with empty result set. --- module/VuFind/src/VuFind/ILS/PaginationHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/VuFind/src/VuFind/ILS/PaginationHelper.php b/module/VuFind/src/VuFind/ILS/PaginationHelper.php index 28bbd2041cd..ef675efef42 100644 --- a/module/VuFind/src/VuFind/ILS/PaginationHelper.php +++ b/module/VuFind/src/VuFind/ILS/PaginationHelper.php @@ -145,7 +145,7 @@ class PaginationHelper { $limit = $pageOptions['limit']; $page = $pageOptions['page']; - if (($page - 1) * $limit >= $count) { + if (($page - 1) * $limit >= $count && $page > 1) { throw new \VuFind\Exception\BadRequest('Page number out of range.'); } if ($pageOptions['ilsPaging'] && $limit < $count) { -- GitLab