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) »
  • Advanced Search Incorrect Filtering on Contact Types/Sub-Types
Pages: [1]

Author Topic: Advanced Search Incorrect Filtering on Contact Types/Sub-Types  (Read 498 times)

pbarmak

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 3
  • CiviCRM version: 3.3.5
  • CMS version: Pressflow 6.19
  • MySQL version: 5.1
  • PHP version: 5.2.10
Advanced Search Incorrect Filtering on Contact Types/Sub-Types
April 05, 2011, 06:36:50 am
Hey all,
It looks like Advanced Search is incorrectly filtering with inputs of contact types if a user selects a parent Type with a Sub-Type of a different parent.
Here is our scenario - we have two parent types ("Individual" plus "Organization", as usual).  We then also have an "Organization" sub-type of "Church".  If an admin selects "Individual" plus "Church" in Advanced Search, we expect it to output both individuals and church-only organizations.  What we see instead is this (on the results screen):
Contact Type - 'Organization' or 'Individual' ...AND...
Contact Subtype - 'Church' ...AND...

It looks like, because Civi holds the Type and Sub-Type of a contact in 2 fields in the db, it splits out the filtering in the query.  Of course, that's not at all what we want.  What we want is something like this:
(Contact Type - 'Organization' and Contact Subtype - 'Church')
OR (Contact Type - 'Individual')

We basically need Advanced Search to "group" the WHERE clauses for contact_type and contact_sub_type together so the filtering is done correctly.

Is there a simple solution to this or should I be filing a bug on it?

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: Advanced Search Incorrect Filtering on Contact Types/Sub-Types
April 05, 2011, 09:40:09 am

I suspect the solution is not-trivial (but not too complex either) but will require code changes.

If you can investigate and create a patch that would be great. Please ping us on IRC if u need help getting started

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) »
  • Advanced Search Incorrect Filtering on Contact Types/Sub-Types

This forum was archived on 2017-11-26.