Bug #1172
closedGroup count wrong when viewing category
Description
The group members are counted incorrectly when viewing a category page, eg:
index.php?option=com_groupjive&action=gj.core.categories.showcategory&catid=2
Looking at the SQL debug output, it seems to be because jos_gj_users is joined twice as shown below:
SELECT a.`id`, a.`name`, a.`type`, DATE_FORMAT( a.`date_s`, '%d.%m.%Y' ) AS date_s, a.`descr`, a.`logo`, a.`user_id`, COUNT AS groupusercount
FROM `jos_gj_groups` AS a
INNER JOIN `jos_gj_grcategory` AS b
ON a.`category` = b.`id`
INNER JOIN `jos_gj_users` AS c
ON a.`id` = c.`id_group`
LEFT JOIN `jos_gj_users` AS x
ON a.`id` = x.`id_group`
etc...
Also, the group members are counted correctly when viewing a search result page, eg:
index.php?option=com_groupjive&action=gj.core.search.searchgroup&limit=100
But it also includes inactive members. Adding the following to the SQL would resolve this:
AND c.`status` = 'active'
I hope this helps :-)