dev/core#4726 Ensure that quickform mapper default value is set correctly for do_not_...
authorSeamus Lee <seamuslee001@gmail.com>
Wed, 25 Oct 2023 00:05:37 +0000 (11:05 +1100)
committerSeamus Lee <seamuslee001@gmail.com>
Wed, 25 Oct 2023 01:06:45 +0000 (12:06 +1100)
Fix test failure

CRM/Import/ImportProcessor.php
tests/phpunit/CRM/Contact/Import/Form/MapFieldTest.php

index fbbe9d85ee42c9a4565d71c9bb69da505a90ea9d..4938dff9b742f38c03e4e382aef0629c5526cafb 100644 (file)
@@ -583,11 +583,6 @@ class CRM_Import_ImportProcessor {
   public function getSavedQuickformDefaultsForColumn($column) {
     $fieldMapping = [];
 
-    // $sel1 is either unmapped, a relationship or a target field.
-    if ($this->getFieldName($column) === 'do_not_import') {
-      return $fieldMapping;
-    }
-
     if ($this->getValidRelationshipKey($column)) {
       $fieldMapping[] = $this->getValidRelationshipKey($column);
     }
index 7e7e72495f0c8a57dcb68bee3b9e96c044c57c8c..7af3de10c927119319500b31494a1b5edf007373 100644 (file)
@@ -261,7 +261,7 @@ class CRM_Contact_Import_Form_MapFieldTest extends CiviUnitTestCase {
       [
         ['name' => 'do_not_import', 'contact_type' => 'Individual', 'column_number' => 0],
         "swapOptions(document.forms.MapField, 'mapper[0]', 0, 4, 'hs_mapper_0_');\n",
-        ['mapper[0]' => []],
+        ['mapper[0]' => ['do_not_import']],
       ],
     ];
   }