Skip to Content Skip to Menu

[SOLVED] CB list bug contains filter is missing %

  • Tazzios
  • Tazzios
  • OFFLINE
  • Posts: 6
  • Thanks: 1
  • Karma: 0
3 years 7 months ago - 3 years 7 months ago #324393 by Tazzios
I want to filter a list based on a Check Box (Multiple) field. But then only returns results when one option is selected.

Example:
Field: cb_Options
Values:Option1,Option2
CB list Filter is set as: 'Options contains Option1'
Result
Only users that have only the Option1 showing up.
If they have both selected there are not shown.

Looking at the query i found the problem
((cb_Options LIKE 'Option1'))
should be
((cb_Options LIKE '%Option1%'))


How many post do i need for link rights?:silly:
Last edit: 3 years 7 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
3 years 7 months ago #324402 by krileon
Replied by krileon on topic CB list bug contains filter is missing %
Userlists default to simple "is" searching, which is exact matching so it won't have wildcards. Change the userlist search behavior to simple "any" or advanced. Suggest downloading and reading through the CB Primer Book as it'll be of great help getting things initially configured.

www.joomlapolis.com/downloads/documents


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.

  • Tazzios
  • Tazzios
  • OFFLINE
  • Posts: 6
  • Thanks: 1
  • Karma: 0
3 years 7 months ago #324406 by Tazzios
Replied by Tazzios on topic CB list bug contains filter is missing %
Sorry but if you put a 'contains' option in the dropdown i expect that it works like a contains and not like 'equal to' which is also available in the drop down .

At the 'does not contain' option you do it correctly.
( ( `options` NOT LIKE '%option1%' OR `options` IS NULL ) )

Why not do add % for contains so that it is working as the option is suggesting instead that people have to find out that the contains is a dummy option that is not working?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
3 years 7 months ago #324408 by krileon
Replied by krileon on topic CB list bug contains filter is missing %
Works perfectly fine in my tests. Under the Filters tab of my userlist the following have been tested.

Field: cb_checkbox
Operator: Contains
Value: Option1

Results in the following.

Code:
AND ( `cb_checkbox` LIKE '%Option1%' )

Field: cb_checkbox
Operator: Does not contain
Value: Option1

Results in the following.

Code:
AND ( ( `cb_checkbox` NOT LIKE '%Option1%' OR `cb_checkbox` IS NULL ) )

Works fine combining the two as well.

Code:
AND ( `cb_checkbox` LIKE '%Option1%' AND ( `cb_checkbox` NOT LIKE '%Option2%' OR `cb_checkbox` IS NULL ) )

Your instance of ((cb_Options LIKE 'Option1')) was probably due to a search on the userlist and not a filter. Searching the userlist with simple "is" search mode will result in no wildcards.


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.
The following user(s) said Thank You: Tazzios

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

  • Tazzios
  • Tazzios
  • OFFLINE
  • Posts: 6
  • Thanks: 1
  • Karma: 0
3 years 7 months ago - 3 years 7 months ago #324412 by Tazzios
Replied by Tazzios on topic CB list bug contains filter is missing %
Your right after retesting i found out 2 flaws of my own. :pinch:

1. The filtering in my list was incorrect because i mixed up value and label, so it was correct that there was no result.
2. Because the list was not working as i expected i put on debug code and found that % was missing,.. but this was a select from my own listmodule that was shown on the same page. :blush:
Last edit: 3 years 7 months ago by Tazzios.

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

Moderators: beatnantkrileon
Powered by Kunena Forum