Details
Description
I have concluded the dedupe finding functions should call an api rather than so much logic in the form.
Remove the Finder::dupesInGroup function in favour of the api call.
civicrm_api3('Duplicate', 'get, array('group_id' => x, 'rule_group_id' => y);
$result = array('values' => array(0 =>3, 1=>4, 'weight' => 20);
I will look to move to a format where the ids (3 & 4) are in an array called 'ids' or are indexed by a field name - possible 'keep_id' & 'remove_id' as that is in use elsewhere & seems clearer than 'srcID' & 'dstID' which is what is being used in the code. I expect this to be resolved over the next couple of refactorings, which should hit the same release
Last time we discussed this is got derailed on the suggestion there should be the option of more than 2 ids returned. The ids format supports that, but it's not consistent with returning 'weight' which applies to a specific pairing. I'm inclined to stick to this api being about pairs and a future api might meet another need.
Once moved out into an extension the extension will be compulsory - I don't know how we enforce that. I'm currently thinking to put the Dedupe finder code into one extension, the Merge code into another and the merge screens into a third. Thinking is mostly around the work happening on different time frames on the 3 areas.