From: Jon Goldberg Date: Thu, 25 Jun 2020 16:26:02 +0000 (-0400) Subject: Multi record import screen fix X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a55b3c0b5090e5d58b2b1474f5bcc18cb0b5332f;p=civicrm-core.git Multi record import screen fix --- diff --git a/CRM/Core/BAO/Mapping.php b/CRM/Core/BAO/Mapping.php index 56c1d9e020..309972bb6a 100644 --- a/CRM/Core/BAO/Mapping.php +++ b/CRM/Core/BAO/Mapping.php @@ -151,6 +151,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping { civicrm_api3('OptionValue', 'create', [ 'option_group_id' => 'mapping_type', 'label' => $mappingType, + 'name' => $mappingType, 'value' => max(array_keys($mappingValues['values'])) + 1, 'is_reserved' => 1, ]); diff --git a/tests/phpunit/CRM/Core/BAO/MappingTest.php b/tests/phpunit/CRM/Core/BAO/MappingTest.php index 50dea9ef59..fb71da022e 100644 --- a/tests/phpunit/CRM/Core/BAO/MappingTest.php +++ b/tests/phpunit/CRM/Core/BAO/MappingTest.php @@ -219,4 +219,11 @@ class CRM_Core_BAO_MappingTest extends CiviUnitTestCase { ]; } + /** + * Ensure getCreateMappingValues() doesn't return an error when there are spaces in the name. + */ + public function testGetCreateMappingValues() { + CRM_Core_BAO_Mapping::getCreateMappingValues("Import Multi value custom data"); + } + }