Searching on address custom field for shared address
Found this on Drupal 7 / Civi 5.28.3. We have a custom group on the Address entity with one custom field, and we often use shared addresses for our contacts (for example, an individual uses the address configured on a household contact).
For the contact using the shared address (i.e. the individual in the example above):
- The custom field does appear for them, for example on their contact summary page.
- The custom field does not get associated with them when doing any sort of searching (tested in advanced search and search builder).
I tested and confirmed this in dmaster (5.31.alpha1) with the following steps:
- Created custom group for Address, with custom alphanumeric field as a select input with 3 options.
- Created individuals test1 and test2, with relationship between them (I think actually the relationship is not needed, but anyways..).
- Created address on test1 with "opt2" selected on custom field. On test2 selected this address to use as a shared address.
- At this point both contact summary pages display the correct complete address with opt2 showing.
- Do advanced search for address custom field opt2. Only contact test1 shows up.
- Do search builder search for parameter Contacts -> Addr customgroup:customfield -> Primary -> equals -> opt2. Only contact test1 shows up.