I'm working on a site that uses several contact subtypes for the Organisation contact type. Following a recent upgrade, everything seems to be working fine, but a basic or advanced search for contacts of this particular subtype gives zero results. Searches for other contact subtypes are working fine. Looking at the database I can see that there are in excess of 1300 contact records with this contact subtype, and they aren't in the trash.

Any thoughts on what the issue might be, how to fix it, or how to work around it (I was thinking about the possibility of creating a new contact subtype and applying this to all of the records - assuming of course that I can find them!).

  • 1
    What version are you on now? Is the subtype enabled at Administer > Customise > Contact Types?
    – Aidan
    Mar 29 '17 at 8:55
  • Hi Aidan. I'm running 4.7.16 and yes the subtype is enabled. Here's the thing: if I find a record that I know to be of this subtype, edit and save the record without making any changes, it then shows up when I search for contacts of the that subtype. What's happening here? Is there some neat way to update all records so that this gets resolved? I hope so.
    – Graham
    Apr 2 '17 at 21:13
  • 1
    I'd dig around a bit using SQL & API to compare a record that is showing correctly with one that is not to try to understand the difference. You could try the api version of your edit/no-change/save ie civicrm_api3('Contact', 'create', array('id' => an_existing_broken_id)). You may need to specify more parameters. If that works, you could just loop through your contacts with that.
    – Aidan
    Apr 3 '17 at 8:42

I remember there was a patch for a contact type search...let me dig....that was with CiviCRM 4.6 and the issue was https://issues.civicrm.org/jira/browse/CRM-18063. The patch worked for me, but I am not sure if you have the same problem?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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