diff --git a/views_litepager_plugin_pager_lite.inc b/views_litepager_plugin_pager_lite.inc index 46ce498..0ef938b 100644 --- a/views_litepager_plugin_pager_lite.inc +++ b/views_litepager_plugin_pager_lite.inc @@ -31,13 +31,19 @@ class views_litepager_plugin_pager_lite extends views_plugin_pager_full { } } - function post_execute(&$result) { + function pre_render(&$result) { if (count($result) > $this->options['items_per_page']) { array_pop($result); $this->next_page = TRUE; global $pager_page_array, $pager_total, $pager_total_items; + if ($pager_page_array[$this->options['id']] == -1) { + $this->set_current_page(); + } $pager_total[$this->options['id']] = $pager_page_array[$this->options['id']] + 1; } + else { + $this->set_current_page(); + } } function render($input) {