- if ($name == 'rel_table_users') {
- $relTables[$name]['main_url'] = str_replace('%ufid', $mainUfId, $relTables[$name]['url']);
- $relTables[$name]['other_url'] = str_replace('%ufid', $otherUfId, $relTables[$name]['url']);
- $find = ['$ufid', '$ufname'];
- if ($mainUser) {
- $replace = [$mainUfId, $mainUser->name];
- $relTables[$name]['main_title'] = str_replace($find, $replace, $relTables[$name]['title']);
- }
- if ($otherUser) {
- $replace = [$otherUfId, $otherUser->name];
- $relTables[$name]['other_title'] = str_replace($find, $replace, $relTables[$name]['title']);
- }
+ if ($name === 'rel_table_users') {
+ // @todo - this user url stuff is only needed for the form layer - move to CRM_Contact_Form_Merge
+ $relTables[$name]['main_url'] = str_replace('%ufid', CRM_Core_BAO_UFMatch::getUFId($otherId), $relTables[$name]['url']);
+ $relTables[$name]['other_url'] = str_replace('%ufid', CRM_Core_BAO_UFMatch::getUFId($otherId), $relTables[$name]['url']);