Skip to content

Commit

Permalink
CIVICRM-1290 Remove "Copy Case custom data" code
Browse files Browse the repository at this point in the history
Remove "Copy Case custom data" code. Fixes https://lab.civicrm.org/dev/core/issues/1183
  • Loading branch information
agileware-justin committed Aug 20, 2019
1 parent ada3470 commit 890ca27
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions CRM/Case/BAO/Case.php
Original file line number Diff line number Diff line change
Expand Up @@ -2084,28 +2084,6 @@ public static function mergeCases(
continue;
}

// CRM-11662 Copy Case custom data
$extends = array('case');
$groupTree = CRM_Core_BAO_CustomGroup::getGroupDetail(NULL, NULL, $extends);
if ($groupTree) {
foreach ($groupTree as $groupID => $group) {
$table[$groupTree[$groupID]['table_name']] = array('entity_id');
foreach ($group['fields'] as $fieldID => $field) {
$table[$groupTree[$groupID]['table_name']][] = $groupTree[$groupID]['fields'][$fieldID]['column_name'];
}
}

foreach ($table as $tableName => $tableColumns) {
$insert = 'INSERT INTO ' . $tableName . ' (' . implode(', ', $tableColumns) . ') ';
$tableColumns[0] = $mainCaseId;
$select = 'SELECT ' . implode(', ', $tableColumns);
$from = ' FROM ' . $tableName;
$where = " WHERE {$tableName}.entity_id = {$otherCaseId}";
$query = $insert . $select . $from . $where;
$dao = CRM_Core_DAO::executeQuery($query);
}
}

$mainCaseIds[] = $mainCaseId;
//insert record for case contact.
$otherCaseContact = new CRM_Case_DAO_CaseContact();
Expand Down

0 comments on commit 890ca27

Please sign in to comment.