diff --git a/application/controllers/GroupController.php b/application/controllers/GroupController.php index 0f45802cb..bf027c836 100644 --- a/application/controllers/GroupController.php +++ b/application/controllers/GroupController.php @@ -1,12 +1,14 @@ applyFilter($filterEditor->getFilter()); $this->setupFilterControl($filterEditor); - $this->getTabs()->activate('group/list'); + try { + $this->view->groups = $query->paginate(); + $this->setupPaginationControl($this->view->groups); + } catch (Exception $e) { + Notification::error($e->getMessage()); + } + $this->view->backend = $backend; - $this->view->groups = $query->paginate(); + $this->getTabs()->activate('group/list'); $this->setupLimitControl(); - $this->setupPaginationControl($this->view->groups); $this->setupSortControl( array( 'group_name' => $this->translate('Group'), diff --git a/application/views/scripts/group/list.phtml b/application/views/scripts/group/list.phtml index 6e63fafdb..9b1b545d2 100644 --- a/application/views/scripts/group/list.phtml +++ b/application/views/scripts/group/list.phtml @@ -18,6 +18,11 @@ if ($backend === null) { return; } +if (! isset($groups)) { + echo $this->translate('Failed to fetch any groups') . ''; + return; +} + if (count($groups) === 0) { echo $this->translate('No groups found matching the filter') . ''; return;