From: JKingsnorth Date: Tue, 27 Aug 2019 09:34:33 +0000 (+0100) Subject: Set current user and date when copying events X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=997602c94c6561e4b05af48ad3638812153e3c28;p=civicrm-core.git Set current user and date when copying events --- diff --git a/CRM/Event/BAO/Event.php b/CRM/Event/BAO/Event.php index 54e4b727bf..5401999d82 100644 --- a/CRM/Event/BAO/Event.php +++ b/CRM/Event/BAO/Event.php @@ -926,6 +926,7 @@ WHERE civicrm_event.is_active = 1 * @throws \CRM_Core_Exception */ public static function copy($id, $params = []) { + $session = CRM_Core_Session::singleton(); $eventValues = []; //get the required event values. @@ -940,7 +941,15 @@ WHERE civicrm_event.is_active = 1 CRM_Core_DAO::commonRetrieve('CRM_Event_DAO_Event', $eventParams, $eventValues, $returnProperties); - $fieldsFix = ['prefix' => ['title' => ts('Copy of') . ' ']]; + $fieldsFix = [ + 'prefix' => [ + 'title' => ts('Copy of') . ' ', + ], + 'replace' => [ + 'created_id' => $session->get('userID'), + 'created_date' => date('YmdHis'), + ], + ]; if (empty($eventValues['is_show_location'])) { $fieldsFix['prefix']['is_show_location'] = 0; }