Search-kit - declaring joins breaks deduping
@colemanw added code to searchkit to support being able to add a pseudojoin in search - in our case it was a join to another table with a list of kanji that are common Japanese family names and we can now find Japanese people whose name fields are likely transposed through the search kit UI
The mechanism is a hook that adds additional 'links' to a DAO and defining the pseudolink in there in order to 'tell search kit about it'
However, it turns out this causes a problem deduping - the dedupe code calls
CRM_Core_DAO::getReferencesToContactTable();
and assumes all the returned fields are references to the contact id field. With the fix above that is not the case and it attempts to do weird things to the pseudojoined tables.
We could alter the dedupe code - but I'm wondering if there are other affected edge cases we need to think about. The change log is one possibility but it still seems to be working on our site
@colemanw @totten thoughts about whether we fix this as a dedupe problem or whether we should refine the add-links--joins-to-search-kit 'feature' to not leak - I am putting up a test to demonstrate the failure