CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Profile search within a group
Pages: [1]

Author Topic: Profile search within a group  (Read 845 times)

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Profile search within a group
November 24, 2008, 01:17:35 pm
I've got a profile setup that is tied to a group.
Within the profile, I've also enabled searching on groups. Basically the big group tied to the profile contains all current members. Within that big group, I want the user to be able to search on subset (groups).

Problem is that when the query is built, it joins the "parent" group with an OR to all subset groups -- which basically means that the subset groups are always ignored.

So it looks like this --

Profile: Search within "Current Members" group.

Profile field - groups:
- Region 1
x Region 2
- Region 3
- Region 4

Result: 
Member of Group IN Region 2 or Current Members ...AND...
Group Status - "Added"

What I think it *should* be is:
Member of Group IN Current Members AND Region 2 ...AND...
Group Status - "Added"

The group attached to the profile is the "master" group. All other query criteria is a subset within that group, not an addition to it.

I've not been able to trace where the profile group is handled as it relates to profile searches. Core/BAO/CustomQuery.php seems to handle the construction of the query sql, but it doesn't include groups. Profile/Form.php is my next guess, but I don't see where the search functions are handled.

-Brian

support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Profile search within a group
November 24, 2008, 02:37:22 pm

This is a bug and i'm pretty sure that there is an issue for this in 3.0. All search queries are generated by CRM/Contact/BAO/Query.php and we dont have the structure in place to distinguish between AND and OR for group(s)

lobo

A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Profile search within a group

This forum was archived on 2017-11-26.