2

I have a individual contact called: "John Wayne". He is connected to a household called "John and Margret Wayne".

When I search now for "John Wayne" in the simple search an in the advanced search, it only returns the household. Is this a normal behavior? Our NGO workers get super confused about this, is there a way to get the individual and household contact in the result table?

3 Answers 3

2

It should show up both contacts, I suspect there might be something in the setup of your sort name. Could you attach some screen prints so I can see what happens?

3
1

I have just tried your search on the demo site after adding your examples, and I get both contacts if I search for John Wayne in both Advanced Search and Search Contacts.enter image description here

I think this is your desired behaviour?

5
  • Yes exactly. But what could be the reason that It doesn't show both on my installation? I didn't change anything in the sort name settings. Sep 17, 2015 at 15:32
  • 1
    just tried the same on the demo of the CiviCRM v4.6 on Drupal version: d46.demo.civicrm.org I can reproduce the behavior of my installation. On which demo site did you try it? Sep 17, 2015 at 15:53
  • 1
    Concur with Mr Fox. searching "john wayne" on demo via QuickSearch, Find, or Adv Search all return a single result of the household, whereas searching for just "wayne" returns both results
    – petednz - fuzion
    Sep 17, 2015 at 21:37
  • 1
    I tried on the 4.5 demo, so it smells like a 4.6 bug? Sep 19, 2015 at 13:08
  • Argh.. any idea in which modul/file I could fix this my-self? Sep 21, 2015 at 14:52
0

I found a way to get this work. I don't know if it's quite a hack, but it works at least.

Change this line in the "CRM/Contact/BAO/Query.php": public function sortName(&$values):

if ($fieldName == 'sort_name') {
$wc = self::caseImportant($op) ? "LOWER(contact_a.sort_name)" : "contact_a.sort_name";
} else {
$wc = self::caseImportant($op) ? "LOWER(contact_a.display_name)" : "contact_a.display_name";
}

to:

  $wc = self::caseImportant($op) ? "LOWER(contact_a.sort_name)" : "contact_a.sort_name";
  $fieldsub[] = " ( $wc $op $value )";

  $wc = self::caseImportant($op) ? "LOWER(contact_a.display_name)" : "contact_a.display_name";
  $fieldsub[] = " ( $wc $op $value )";
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.