Fixes to dedupe getting dynamic references
Civi 5.26 included PR #17125, "Fix Dedupe entity_tag mangling bug". This introduced the new method
CRM_Dedupe_MergeHandler::getTablesRelatedToTheMergePair(). However, there are two bugs in the implementation:
- It assumes that only one dynamic reference can exist between two tables. In addition to extensions that may introduce dynamic references, this is also untrue in core:
civicrm_pcp_blockhas two dynamic references to
- It assumes that the column specifying the entity is always called
entity_table, and this is hard-coded into the SQL in
getTablesRelatedToTheMergePair(). However, this column isn't always
entity_table. We should pull the correct column name from the metadata.
I don't think there's a Gitlab ticket for PR #17125, so I'm referencing the PR here instead.