Skip to content

Commit

Permalink
Ensure mapping_id is pre-filled into the metadata-template
Browse files Browse the repository at this point in the history
https: //github.com/civicrm/civicrm-core/pull/26108

Bug: T303986

Change-Id: I79f3265e838c9a5523fd3898b97ef82a9d4d95b8
  • Loading branch information
eileenmcnaughton committed Apr 25, 2023
1 parent f0058e0 commit 14e2bea
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ public function setTemplateDefaults(): array {
$mappingID = Mapping::get(FALSE)->addWhere('name', '=', $mappingName)->addSelect('id')->execute()->first()['id'];
// 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']['mapping_id'] = $mappingID;
$userJob['metadata']['template_id'] = $templateID;
$userJob['created_id'] = CRM_Core_Session::getLoggedInContactID();
$userJob['expires_date'] = '+1 week';
Expand Down

0 comments on commit 14e2bea

Please sign in to comment.