No this does not help. I am still havingn issues with the query as it does not return proper results. I have copied the original query from the Jooomla debug mode. It is like this:
Code:
SELECT DISTINCT *
FROM #__users u JOIN #__user_usergroup_map g
ON g.`user_id` = u.`id` JOIN #__comprofiler ue
ON ue.`id` = u.`id`
WHERE u.block = 0
AND ue.approved = 1
AND ue.confirmed = 1
AND ue.banned = 0
AND g.group_id IN (2)
AND (( ( SELECT COUNT(*)
FROM `#__comprofiler_plugin_privacy` AS p
INNER JOIN `#__comprofiler` AS uc
ON p.`user_id` = uc.`user_id`
WHERE uc.`test` != ''
AND p.`type` = 'profile'
AND p.`rule` = '0' )>0))
When I check the result set it is returning users with p.rule !=0. I have no idea why is this. I am looking at the result table and I see users who have p.rule ='ACCESS-2" and should not show up in this query as far as I understand.
When I change the query to p.rule = 999 (just to make sure to use a number that is not in the privacy table, then the resultset is empty as expected.
So what is wrong with setting p.rule = 0? Why does this not return what I expect?
Also uc.test != '' does not have any effect.