From: Eileen McNaughton Date: Tue, 25 Apr 2023 00:05:29 +0000 (+1200) Subject: Ensure mapping id is set in all places using import templates X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=dcbebe171bd55fc00734a8fea7915ec3f34044cb;p=civicrm-core.git Ensure mapping id is set in all places using import templates This fixes the missing update saved mapping option when using a template I think I changed the way the metadata was a few times & so it is a bit confusing - but this ensures it is set in the place MapField is expecting it to be --- diff --git a/CRM/Import/Form/DataSource.php b/CRM/Import/Form/DataSource.php index 3decffef26..48c8046a3e 100644 --- a/CRM/Import/Form/DataSource.php +++ b/CRM/Import/Form/DataSource.php @@ -221,6 +221,7 @@ abstract class CRM_Import_Form_DataSource extends CRM_Import_Forms { // Unset fields that should not be copied over. unset($userJob['id'], $userJob['name'], $userJob['created_date'], $userJob['is_template'], $userJob['queue_id'], $userJob['start_date'], $userJob['end_date']); $userJob['metadata']['template_id'] = $templateID; + $userJob['metadata']['Template']['mapping_id'] = $mappingID; $userJob['created_id'] = CRM_Core_Session::getLoggedInContactID(); $userJob['expires_date'] = '+1 week'; $userJobID = UserJob::create(FALSE)->setValues($userJob)->execute()->first()['id'];