Remove soft credit validation
authorEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 2 Sep 2022 02:35:23 +0000 (14:35 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Sun, 4 Sep 2022 22:02:19 +0000 (10:02 +1200)
It is not possible in the UI to deselect the soft-credit-field field so
let's not validate

CRM/Contribute/Import/Form/MapField.php

index 60499bb907952fcba14a4bcff33fd6a209a59d64..4ba33999ea1316aa3f2197c96e332a15f6ef40f2 100644 (file)
@@ -181,15 +181,6 @@ class CRM_Contribute_Import_Form_MapField extends CRM_Import_Form_MapField {
         if (array_key_exists($val, $ruleFields)) {
           $weightSum += $ruleFields[$val];
         }
-        if ($val == "soft_credit") {
-          $mapperKey = CRM_Utils_Array::key('soft_credit', $importKeys);
-          if (empty($fields['mapper'][$mapperKey][1])) {
-            if (empty($errors['_qf_default'])) {
-              $errors['_qf_default'] = '';
-            }
-            $errors['_qf_default'] .= ts('Missing required fields: Soft Credit') . '<br />';
-          }
-        }
       }
       foreach ($ruleFields as $field => $weight) {
         $fieldMessage .= ' ' . $field . '(weight ' . $weight . ')';