[#8141] Userlist search does not respect date range

3 years 7 months ago - 3 years 7 months ago #320067 by KatoKalin
CB version 2.4.6 with user date field. Date field has min and max value set and validation enabled. It is set to show age in userlist.

Userlist search form correctly offers age range for search.

Submission of search form with age range as only search parameters results in no userlist being shown.

After adding additional search parameter then a userlist gets shown, but date range is not respected. Userlist includes any ages.

In debug more database queries do not show date field to be queried. Request URL for search has no _minval or _maxval parameter. If entered manually, no search results shown.

In conclusion this looks like the date files gets completely ignored for userlist search. Or I am doing something wrong.

Please Log in to join the conversation.

3 years 7 months ago #320076 by krileon
Replied by krileon on topic Userlist search does not respect date range
Parameters won't show in the URL if the URL string is too long. They'll just exist in the pages POST data. Enable Joomla debug mode and review the query at the bottom of the page in query debug information. It should start with the following.

SELECT ue.*, u.*, '' AS 'NA' 
  FROM `jos_users` u
 
  INNER JOIN `jos_comprofiler` AS ue 
  ON ue.`id` = u.`id`
 
  WHERE u.`block` = 0
 
  AND ue.`approved` = 1
 
  AND ue.`confirmed` = 1
  AND ue.`banned` = 0

Note your table prefix may not be jos_. You'll see any search parameters added to the WHERE statement of the query.

Have retested age range searching and appears to be working fine in my tests. That behavior hasn't been touched in a very long time so there's no reason to suspect it doesn't suddenly work now.


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 to join the conversation.

3 years 7 months ago - 3 years 7 months ago #320086 by KatoKalin
Replied by KatoKalin on topic Userlist search does not respect date range
Is the date field supposed do show in the database query?

Because: I have switched on debug mode and looked for the query you have mentioned.
It does not show the date field.
I ran 2 other searches with different search parameter and those fields did show up in the database query.

Maybe interesting: Have this also with a Community builder 2.0.7. So if it is a bug, it is a very old one.

Please Log in to join the conversation.

3 years 7 months ago #320119 by krileon
Replied by krileon on topic Userlist search does not respect date range
Yes, the date field should show in the query. Not sure what to suggest as it's working fine in my tests. Try creating a new date field and see if it searches fine.


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 to join the conversation.

3 years 7 months ago - 3 years 7 months ago #320125 by KatoKalin
Replied by KatoKalin on topic Userlist search does not respect date range
I have created a new date field. I entered a value for this field for only 1 user. So search results should present max. 1 user.
I have even created a new userlist to search for this specific field.

But I receive the same result as above: Any users get listed. The new field does not show up in the search query other search parameter fields to show up in the query.

So what does this mean? If the query does not contain a freshly created date field something seems to be corrupted in recognizing these fields. What could that be and how to fix?
I can confirm I have this issue in multiple versions of CB, tried 2.4.3 as well.

Please Log in to join the conversation.

3 years 7 months ago #320152 by krileon
Replied by krileon on topic Userlist search does not respect date range
Was the field always a date field or did you change its type at some point? If you changed its type you run the risk of breaking its data storage (it warns you of this when changing type). Try running all the database fix tools in CB > Tools to see if there's a database issue. That includes running "Check Community Builder User Fields Database with strict column types" tool.


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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.260 seconds

Facebook Twitter LinkedIn