From 56944d3c95a9d4eda52b1c11717e00890f0d1294 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Mon, 11 Sep 2017 15:43:57 +1000 Subject: [PATCH] CRM-20892 Fix issue where saving to the database wasn't creating a new modified_date --- CRM/Mailing/BAO/Mailing.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php index 3d3cced20b..766da13306 100644 --- a/CRM/Mailing/BAO/Mailing.php +++ b/CRM/Mailing/BAO/Mailing.php @@ -1600,11 +1600,19 @@ ORDER BY civicrm_email.is_bulkmail DESC ) { $params['replyto_email'] = $params['from_email']; } - $mailing->copyValues($params); + // CRM-20892 Unset Modifed Date here so that MySQL can correctly set an updated modfied date. + unset($mailing->modified_date); $result = $mailing->save(); + // CRM-20892 Re find record after saing so we can set the updated modified date in the result. + $mailing->find(TRUE); + + if (isset($mailing->modified_date)) { + $result->modified_date = $mailing->modified_date; + } + if (!empty($ids['mailing'])) { CRM_Utils_Hook::post('edit', 'Mailing', $mailing->id, $mailing); } -- 2.25.1