Skip to content

Commit f7147aa

Browse files
committed
User double shown if in multiple groups
#1
1 parent e607b34 commit f7147aa

File tree

7 files changed

+42
-4
lines changed

7 files changed

+42
-4
lines changed

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/cblistmodule.iml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cblistmodule-3.0.0.zip

7.85 KB
Binary file not shown.

helper.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,13 @@ public static function getData( $params )
194194
// CB19 $select_sql = utf8_encode(substr(urldecode($select_sql_raw), 2, -1));
195195
$json_a=json_decode($select_sql_raw,true);
196196
$filters_basic = $json_a['filter_basic'];
197-
$filter_advanced = $json_a['filter_advanced'];
197+
198+
199+
if (isset($person[$fieldtouse]) ) {
200+
$datatoinsert = $person[$fieldtouse];
201+
}
202+
203+
198204
if ($json_a['filter_mode'] == 0) {
199205
$i = 0;
200206
foreach ($filters_basic as $filter) {
@@ -268,7 +274,9 @@ public static function getData( $params )
268274
}
269275

270276
else if ($json_a['filter_mode'] == 1) {
271-
$select_sql = $filter_advanced;
277+
278+
$select_sql = $json_a['filter_advanced'];
279+
272280
}
273281

274282
if ($list_orderby=='list_default' or $list_orderby=='') {
@@ -298,7 +306,7 @@ public static function getData( $params )
298306
$list_show_unapproved = $json_a['list_show_unapproved'];
299307
$list_show_blocked = $json_a['list_show_blocked'];
300308
$list_show_unconfirmed = $json_a['list_show_unconfirmed'];
301-
$fetch_sql = "SELECT ue.id FROM #__users u JOIN #__user_usergroup_map g ON g.`user_id` = u.`id` JOIN #__comprofiler ue ON ue.`id` = u.`id` WHERE g.group_id IN (".$usergroupids.")";
309+
$fetch_sql = "SELECT DISTINCT ue.id FROM #__users u JOIN #__user_usergroup_map g ON g.`user_id` = u.`id` JOIN #__comprofiler ue ON ue.`id` = u.`id` WHERE g.group_id IN (".$usergroupids.")";
302310
if ($list_show_blocked == 0) {$fetch_sql.=" AND u.block = 0 ";}
303311
if ($list_show_unapproved == 0) {$fetch_sql.=" AND ue.approved = 1 ";}
304312
if ($list_show_unconfirmed == 0) {$fetch_sql.=" AND ue.confirmed = 1 ";}

mod_cblistmodule.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<name>Community Builder list module</name>
44
<author>Tazzios (original Magnus Hasselquist https://github.com/magnushasselquist/hqcblistmodule) </author>
55
<authorUrl>https://github.com/Tazzios</authorUrl>
6-
<version>3.0</version>
6+
<version>3.0.1</version>
77
<creationDate>2021-07-02</creationDate>
88
<license>GNU General Public License version 2 or later</license>
99
<description>Displaying Users from a selected CB List in a Module.</description>

0 commit comments

Comments
 (0)