[Import] Remove handling for unavailable field current_employer
authorEileen McNaughton <emcnaughton@wikimedia.org>
Thu, 19 May 2022 11:18:58 +0000 (23:18 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Thu, 19 May 2022 11:18:58 +0000 (23:18 +1200)
CRM/Contact/Import/Parser/Contact.php

index cae7b3a311b98744958cc435851e049cd5a18953..ef854c573b25a6f519cbe64cbe493ab8258da50b 100644 (file)
@@ -2056,24 +2056,6 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser {
         return civicrm_api3_create_error($error->pop());
       }
     }
-
-    // check for organisations with same name
-    if (!empty($params['current_employer'])) {
-      $organizationParams = ['organization_name' => $params['current_employer']];
-      $dupeIds = CRM_Contact_BAO_Contact::getDuplicateContacts($organizationParams, 'Organization', 'Supervised', [], FALSE);
-
-      // check for mismatch employer name and id
-      if (!empty($params['employer_id']) && !in_array($params['employer_id'], $dupeIds)
-      ) {
-        throw new CRM_Core_Exception('Employer name and Employer id Mismatch');
-      }
-
-      // show error if multiple organisation with same name exist
-      if (empty($params['employer_id']) && (count($dupeIds) > 1)
-      ) {
-        return civicrm_api3_create_error('Found more than one Organisation with same Name.');
-      }
-    }
   }
 
   /**