From: ufundo Date: Mon, 18 Apr 2022 14:13:12 +0000 (+0000) Subject: Update copied event reminders to link to new event when creating from template using... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0045993c8a9549277b821fe3f391a6e5b8ff3304;p=civicrm-core.git Update copied event reminders to link to new event when creating from template using api4 --- diff --git a/CRM/Event/BAO/Event.php b/CRM/Event/BAO/Event.php index 0aadbbae0d..559e651d67 100644 --- a/CRM/Event/BAO/Event.php +++ b/CRM/Event/BAO/Event.php @@ -112,6 +112,19 @@ class CRM_Event_BAO_Event extends CRM_Event_DAO_Event { $copy = self::copy($params['template_id']); $params['id'] = $copy->id; unset($params['template_id']); + + //fix for api from template creation bug + civicrm_api4('ActionSchedule', 'update', [ + 'checkPermissions' => FALSE, + 'values' => [ + 'mapping_id' => CRM_Event_ActionMapping::EVENT_NAME_MAPPING_ID, + ], + 'where' => [ + ['entity_value', '=', $copy->id], + ['mapping_id', '=', CRM_Event_ActionMapping::EVENT_TPL_MAPPING_ID], + ], + ]); + } }