When calculating
<?php
ceil($pager_total_items[$element] / $limit);
?>
$ php -r "echo (int) ceil(PHP_INT_MAX/1);"
we need to either fix the ceil code in
<?php
function pager_default_initialize($total, $limit, $element = 0) {
global $pager_page_array, $pager_total, $pager_total_items, $pager_limits;
$page = pager_find_page($element);
// We calculate the total of pages as ceil(items / limit).
$pager_total_items[$element] = $total;
$pager_total[$element] = ceil($pager_total_items[$element] / $limit);
?>
or fix the initialization of $total to PHP_MAX_INT / 2 in which seems better.
<?php
class Mini
...
public function postExecute(&$result) {
...
pager_default_initialize(PHP_INT_MAX / 2, $this->get_items_per_page(), $this->options['id']);
?>
Attachment | Size | Status | Test result | Operations |
---|---|---|---|---|
core-fix-mini-pager-on-single-item.patch | 718 bytes | Idle | PASSED: [[SimpleTest]]: [MySQL] 55,742 pass(es). | View details | Re-test |