1

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!).

4
  • 1
    What version are you on now? Is the subtype enabled at Administer > Customise > Contact Types?
    – Aidan
    Mar 29, 2017 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, 2017 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, 2017 at 8:42
  • Strangely I just encountered the same issue on 5.62.1 - Basic or Advanced search for a subtype (or D9 view of the same) returns no records while Searchkit, API and a select query on db find them just fine. The workaround given by Graham above still works - edit through GUI without changing anything. Using API to reapply the subtypes to all relevant contacts also worked. To be fair I have been messing around with the subtypes a bit! . Recording this here in case useful to others to know that this can still happen.
    – Jon Halle
    Jun 26 at 22:35

1 Answer 1

2

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 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.