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) »
  • Glitch when using advanced search on Postal Code Range
Pages: [1]

Author Topic: Glitch when using advanced search on Postal Code Range  (Read 495 times)

michael_whitall

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
  • CiviCRM version: 4.1.3
  • CMS version: Drupal
  • MySQL version: 7.14
  • PHP version: 7.14
Glitch when using advanced search on Postal Code Range
July 11, 2012, 11:04:46 am
Under Search > Advanced Search, using the "Postal Code Range" search option under the "Address Fields" section. Suppose I want to search for individual records who either have a Birmingham postcode OR live in West Midlands county. Under "Basic Criteria" I set "Search Operator" to "OR", then specify postcode range from B1 to B99 and set State/Province to West Midlands. This search seems to return the entire database, rather than just the desired records. Presumably the postcode range bit is internally coded to search for postcode>=B1 AND postcode<=B99, but changing the search operator to OR changes the internal coding accordingly, with the result that all postcodes satisfy the search conditions.  Anyway the postcode range search only seems to behave if "Search Operator" is set to "AND"; how can I fix this?

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: Glitch when using advanced search on Postal Code Range
July 11, 2012, 11:30:05 am

You'll need to check and fix:

CRM/Contact/BAO/Query.php

We currently treat the postal code range as two separate fields and hence it does not work. It should be treated as a unified field irrespective of the operator

Might want to check relation_target and how we handle a set of related fields together in that file

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) »
  • Glitch when using advanced search on Postal Code Range

This forum was archived on 2017-11-26.