CIVICRM-1290 Remove "Copy Case custom data" code
authorJustin Freeman <justin@agileware.com.au>
Fri, 16 Aug 2019 07:20:50 +0000 (17:20 +1000)
committerJustin Freeman <justin@agileware.com.au>
Tue, 20 Aug 2019 01:35:46 +0000 (11:35 +1000)
Remove "Copy Case custom data" code. Fixes https://lab.civicrm.org/dev/core/issues/1183

CRM/Case/BAO/Case.php

index 1b1340a9ef17c30887344fdd688c2977471c8621..f947784c068b93e06a4bf0c76b162afacf7ae44a 100644 (file)
@@ -2084,28 +2084,6 @@ HERESQL;
           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();