Inoperative Next & Last Page UI navigation controls for Group Management
Piler version 1.1.0, build 884
If there is more than one page of entries on the Group Management UI page (administration > groups) the Next and Last page navigation controls do nothing. Manually changing the URL to include &page=1 &page=2 (etc) displays subsequent pages of entries, as expected. The Previous and First Page controls function correctly on all pages.
Looking at the <div class="pagenav"> section in mailpiler/view/theme/default/templates/group/list.tpl, it appears that two variables used to determine the next/last controls contain unexpected values. The variables are $total_groups and $total_pages.
For example, we have 43 groups that span 3 pages ($page_len=20). When $page=0, $total_groups=1, $next_page=1, $total_pages=0 When $page=1, $total_groups=1, $next_page=2, $total_pages=0 When $page=2, $total_groups=1, $next_page=3, $total_pages=0
This obviously only affects the administrator and there is a manual work-around; no urgency to resolve.
Comments (4)
-
repo owner -
reporter Thanks, Janos. That works perfectly for the next page, previous page and first page controls. The last page control is still not a link, because $total_pages=0
-
repo owner Apply the following diff to fix it (sorry for the long time it took me):
diff --git a/webui/controller/group/list.php b/webui/controller/group/list.php index b5c164a..0e34d8b 100644 --- a/webui/controller/group/list.php +++ b/webui/controller/group/list.php @@ -74,7 +74,7 @@ class ControllerGroupList extends Controller { $this->data['prev_page'] = $this->data['page'] - 1; $this->data['next_page'] = $this->data['page'] + 1; - $this->data['total_pages'] = floor($this->data['total_users'] / $this->data['page_len']); + $this->data['total_pages'] = floor($this->data['total_groups'] / $this->data['page_len']); $this->render();
-
repo owner - changed status to resolved
- Log in to comment
There's a bug in the related model. Apply the following diff against model/group/group.php, and it should be fixed: