Contact.getDuplicates doesn't accept states, countries by name
Overview
Contact.getDuplicates doesn't accept states or countries by name.
Reproduction steps
- Go to https://dmaster.demo.civicrm.org/civicrm/api4#/explorer/Contact/getDuplicates?values=[["address_primary.country_id",""]].
- See the endless spinning logo next to the select menu.
That's not the actual problem, though I believe it's the same root cause.
If you want to actually replicate it, you can run this:
\Civi\Api4\Contact::getDuplicates(FALSE)
->setDedupeRule('Individual.Unsupervised')
->addValue('address_primary.country_id:name', 'United States')
->execute();
Current behaviour
Exception thrown: No option list found for 'address_primary.country_id'
Expected behaviour
Should accept a state abbreviation, name, label, etc.