Prevent current page from being 0 if no items are present
This commit is contained in:
@@ -43,7 +43,7 @@ class GenericTable
|
||||
$this->start = empty($options['start']) || !is_numeric($options['start']) || $options['start'] < 0 || $options['start'] > $this->recordCount ? 0 : $options['start'];
|
||||
|
||||
// Figure out where we are on the whole, too.
|
||||
$numPages = ceil($this->recordCount / $this->items_per_page);
|
||||
$numPages = max(1, ceil($this->recordCount / $this->items_per_page));
|
||||
$this->currentPage = min(ceil($this->start / $this->items_per_page) + 1, $numPages);
|
||||
|
||||
// Let's bear a few things in mind...
|
||||
|
||||
Reference in New Issue
Block a user