Skip to content

Commit

Permalink
count() usually returns strings
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly authored Sep 6, 2017
1 parent b4052ad commit 1e788ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/helpers/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static function paginateCriteria(ElementQueryInterface $query): array

// Get the total result count, without applying the limit
$query->limit = null;
$total = $query->count();
$total = (int)$query->count();
$query->limit = $limit;

// Bail out early if there are no results. Also avoids a divide by zero bug in the calculation of $totalPages
Expand Down Expand Up @@ -129,7 +129,7 @@ public static function paginateCriteria(ElementQueryInterface $query): array

$paginateVariable->first = $offset + 1;
$paginateVariable->last = $last;
$paginateVariable->total = (int)$total;
$paginateVariable->total = $total;
$paginateVariable->currentPage = $currentPage;
$paginateVariable->totalPages = $totalPages;

Expand Down

0 comments on commit 1e788ee

Please sign in to comment.