Skip to Content Skip to Menu

[SOLVED] Search with single checkbox does not work

6 years 3 months ago - 6 years 3 months ago #306515 by haraldundandrea
Hello,

I created a field with type checkbox single and set it to searchable.

The field is displayed but if an option (yes or no) is choosen, there are no results even if there are profile with the choosen option entered.

What have I to change so that I can use the checkbox for selection of users by the entered option of the checkbox?

Greetings - Harald
Last edit: 6 years 3 months ago by krileon. Reason: Added [SOLVED] tag to subject

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
6 years 3 months ago #306535 by krileon
Replied by krileon on topic Search with single checkbox does not work
Seams to work fine in my tests. Are you sure you aren't applying other search criteria when checking checkbox searching? If you select Yes it should find all users who have checked the checkbox. If you select No it should find all users who have not checked the checkbox.


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.

6 years 3 months ago #306546 by haraldundandrea
Replied by haraldundandrea on topic Search with single checkbox does not work
I have tested it with some configuration but the result was everytime 0 users found. My expected result was that all users were found as the field was new and therefore the field should be unchecked in all profiles.

So I used my Name as first criteria to see if my Profile is found.

In a second step I added No for the ceckbox with the same result, although I have unchecked the Checkbox in my own profile.

At last I tried the reverse. I checked to checkbox in my profile and used yes for the search. Unfortunately with same result. My profile was not found.

Then I wrote my post here.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
6 years 3 months ago #306554 by krileon
Replied by krileon on topic Search with single checkbox does not work
For new fields the value is NULL. So it's not checked or unchecked. Suppose you could set it to 0 in your database to force everyone's checkbox field to 0. New registrations should set it to 0 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 or Create an account to join the conversation.

6 years 3 months ago #306558 by haraldundandrea
Replied by haraldundandrea on topic Search with single checkbox does not work
Can you give me a hint how I can find the right field in my database, for example witch table and witch fieldname?

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

6 years 3 months ago - 6 years 3 months ago #306560 by haraldundandrea
Replied by haraldundandrea on topic Search with single checkbox does not work

krileon wrote: For new fields the value is NULL. So it's not checked or unchecked.


That was the problem! Now I updated my profile twice, firsttime I checked the checkbox and saved the changes, second time I unchecked the checkbox. Now my Profile is found as expected! Fine! :)

Now I only have to find the field in my database to change all values to 0 or 1 for "preset". ;)

Update: I found the value of witch field I have to change:

UPDATE `prefix_comprofiler` SET `fieldname` = 1

If someone wants to do the same Thing or something similar... ;)

Thanks a lot for your support!
Last edit: 6 years 3 months ago by haraldundandrea.
The following user(s) said Thank You: krileon

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

Moderators: beatnantkrileon
Powered by Kunena Forum