Merge pull request #18360 from colemanw/fixMultiInProfile
[civicrm-core.git] / CRM / Import / ImportProcessor.php
index 4cd1d9b256e7297ae7d4fb8a025c3f498d39f2f6..27508e0aea17170f0993bdf9d7dca212e1ba5d24 100644 (file)
@@ -112,8 +112,8 @@ class CRM_Import_ImportProcessor {
    *
    * @param string $contactSubType
    */
-  public function setContactSubType(string $contactSubType) {
-    $this->contactSubType = $contactSubType;
+  public function setContactSubType($contactSubType) {
+    $this->contactSubType = (string) $contactSubType;
   }
 
   /**
@@ -488,6 +488,7 @@ class CRM_Import_ImportProcessor {
    */
   protected function getNameFromLabel($label) {
     $titleMap = array_flip($this->getMetadataTitles());
+    $label = str_replace(' (match to contact)', '', $label);
     return $titleMap[$label] ?? '';
   }
 
@@ -499,7 +500,7 @@ class CRM_Import_ImportProcessor {
    * @return bool
    */
   protected function isValidRelationshipKey($key) {
-    return !empty($this->getValidRelationships()[$key]) ? TRUE : FALSE;
+    return !empty($this->getValidRelationships()[$key]);
   }
 
   /**