Skip to Content Skip to Menu

CB 1.9.1 CB Privacy -> Bug

  • KatoKalin
  • KatoKalin
  • OFFLINE
  • Posts: 265
  • Thanks: 11
  • Karma: -5
  • Add-ons
10 years 4 months ago - 10 years 4 months ago #245945 by KatoKalin
Replied by KatoKalin on topic CB 1.9.1 CB Privacy -> Bug
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.
Last edit: 10 years 4 months ago by KatoKalin.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 4 months ago #245960 by krileon
Replied by krileon on topic CB 1.9.1 CB Privacy -> Bug
Public = 0
Private = 99

Please review my previous reply carefully. All the queries I've provided in my previous reply I have tested as working. They do not take into account users with no private row except my last example. If a user has no private row their count will be 0 and they will not be visible. To avoid this you can use the below, which shows everyone that isn't set to Private (including those without a privacy row).

Code:
( ( SELECT COUNT(*) FROM `#__comprofiler_plugin_privacy` AS p WHERE p.`type` = 'profile' AND p.`user_id` = u.`id` AND `rule` = 99 ) = 0 )

There's no need to alter the query. Just straight copy and paste it to Advanced Filter on your userlist.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • KatoKalin
  • KatoKalin
  • OFFLINE
  • Posts: 265
  • Thanks: 11
  • Karma: -5
  • Add-ons
10 years 4 months ago #245972 by KatoKalin
Replied by KatoKalin on topic CB 1.9.1 CB Privacy -> Bug
This looks much better now, but not yet final.
Now this code does not respect the users that are not in the privacy table. So what would be the best approach:

1. Manually add all missing users into the privacy table
2. Alter the filter to use default privacy setting for users that are not present in privacy table. And what would be the required query for this?

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 4 months ago - 10 years 4 months ago #245988 by krileon
Replied by krileon on topic CB 1.9.1 CB Privacy -> Bug

Now this code does not respect the users that are not in the privacy table.

Correct, it was specifically setup to do just that. If you want it to ignore users with a privacy row then you need to adjust it further as follows.

Code:
( ( SELECT COUNT(*) FROM `#__comprofiler_plugin_privacy` AS p WHERE p.`type` = 'profile' AND p.`user_id` = u.`id` AND `rule` = 0 ) > 0 )

The above will only show users who have their profiles specifically set to Public.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 10 years 4 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • KatoKalin
  • KatoKalin
  • OFFLINE
  • Posts: 265
  • Thanks: 11
  • Karma: -5
  • Add-ons
10 years 4 months ago #246000 by KatoKalin
Replied by KatoKalin on topic CB 1.9.1 CB Privacy -> Bug
Ok. I think from there I can figure out what to do next. Thanks.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum