[SOLVED] CB List Search

9 years 10 months ago - 9 years 10 months ago #246037 by stuntlist
[SOLVED] CB List Search was created by stuntlist
Hi,

We have a Joomla 3.3.0 site using CB 1.9.1 and CB Subs 3.0.

We have 3 regions in the site and use a cb field for the region setting. Canada/East/West

I have setup a CB list that only shows 1 region of users, say West. When you go to that list, it only shows the West users. If you click the Search button to display the search fields and choose some parameters to search on, say Gender. What happens is that it seems to loose the list filters and only search on the search fields that have been choosen. So, instead of getting just West Females, what we actually get is all Females. We need to have a way for the filters to 'stay applied' along with the search fields that have been entered. The filters need to be 'hidden' search fields that the end user doesn't have to enter, since they have already 'set' them when they went to the West search page.

How can we achieve this?

Thank you

Please Log in to join the conversation.

9 years 10 months ago #246062 by krileon
Replied by krileon on topic CB List Search
The filters will always apply unless you have a search criteria available that conflicts with the filter then it could result in an odd query. For example if you filter by your Region CB field then don't allow searching on that field.

Enable debug mode then review the bottom of your userlist for the database queries made on the page and check that the userlist query is correct. It should contain _comprofiler and _users tables then you should see your filter and search criteria in the WHERE statement.


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.

9 years 10 months ago #246073 by stuntlist
Replied by stuntlist on topic CB List Search
Hi Kyle,

Here is the problem, the serach is using the default list rather than the current list when it goes to get the search results. This is the MySQL query that I see coming up:
SELECT *
 
  FROM `st2_comprofiler_lists`
 
  WHERE `listid` = '2'
Listid 2 is the default CB list, but I was in CB list 30 when I did the search, which has the region filter set to what I wanted.

So, is there anyway to make the software use the current list for the search rather than defaulting to the default list? At this point I am fine with hacking the software to get it to work.

If not, is there a way that I can set a hidden field that will be added to the search criteria, that sets the region I want searched. I have a cookie which contains the region, so I know what value to set the 'hidden' field to, if there was a way to do that.

Thank you for your help.

Please Log in to join the conversation.

9 years 10 months ago #246077 by krileon
Replied by krileon on topic CB List Search
Did you remove the list dropdown? Doing that causes listid to no longer post. If you removed it you'll need to add a hidden input with the listid or just hide it using CSS so it's still there, but not visible.


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.

9 years 10 months ago - 9 years 10 months ago #246082 by stuntlist
Replied by stuntlist on topic CB List Search
Hi Kyle,

Thank you so much that solved that problem, so now the list persists when I have a hidden field with the listid in it.

Next problem. In the CB Menu List item, I set the "Search Mode" dropdown to "Search only" and then go to the menu item it is showing me the list of members rather than just the search parameters. So, I output the variable: $searchFormValuesRAW from comprofiler.php around line 860 and the array is empty because the $_GET variable is not being filled in.

As you suggested previously, I could try to install the CB2.0B4 cb plugin, which I did. Then when I go to the page I get the search parameters being displayed, as the $searchFormValuesRAW variable gets filled in. But, when I choose something to search for and submit, nothing happens. I just get the search parameters being displayed again.

Here is what gets filled in $searchFormValuesRAW when you go to the search page the first time:
Array ( [option] => com_comprofiler [listid] => 30 [searchmode] => 1 [Itemid] => 205 [task] => userslist )
then you set some search criteria and submit it shows:
Array ( [option] => com_comprofiler [task] => usersList [Itemid] => 205 [limitstart] => 0 [search] => [cbsecuritym3] => cbm_7615fa61_52e3e630_25b60e0c9c80799572221b12e9f5cdaf [firstname] => [lastname] => [cb_weightlbs__minval] => [cb_weightlbs__maxval] => [cb_heightsingle] => [cb_age] => Teen/Youth [cb_sex] => Female [listid] => 30 [view] => userslist [searchmode] => 1 )

I think the problem may be that the [searchmode] is still set to 1 instead of being removed from the array, but I don't know where or how that is being handled.

In case it was something else in the CB plugin that was causing the issue, I tried unpublishing the plugin and moving the onAfterRoute function into comprofiler renaming it and calling it right before the $searchFormValuesRAW is set to the $_GET variables. But got the same results, the [searchmode] is still being set. On the live Joomla 1.5 site I get these settings after the search criteria has been submitted:
Array ( [option] => com_comprofiler [task] => usersList [Itemid] => 49 [limitstart] => 0 [search] => [cbsecuritym3] => cbm_0e95b143_09d760fd_0c2e6fe3d0c6da388bda38617ba2a901 [firstname] => [lastname] => [cb_weightlbs__minval] => [cb_weightlbs__maxval] => [cb_heightsingle] => [cb_zone] => [cb_age] => Teen/Youth [cb_sex] => Female )

Here is the link to the search page: test.stuntlist.com/west/member-search

Any ideas how to get the search mode to work properly?

We are getting very close to being able to migrate the site, hopefully this is the last issue.

Thank you again for your help.

Please Log in to join the conversation.

9 years 10 months ago #246108 by krileon
Replied by krileon on topic CB List Search
The fix for that in CB 2.0 is to make sure the searchmode is set to 0 for the base URL so when submitting the form it's set to allow search results. This is done by editing $ue_base_url in usersList of the below file and adding &searchmode=0, but I've no idea if this will fix anything in CB 1.x.

components/com_comprofiler/comprofiler.html.php


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.234 seconds

Facebook Twitter LinkedIn