From: Seamus Lee Date: Mon, 11 Sep 2017 05:43:57 +0000 (+1000) Subject: CRM-20892 Fix issue where saving to the database wasn't creating a new modified_date X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=56944d3c95a9d4eda52b1c11717e00890f0d1294;p=civicrm-core.git CRM-20892 Fix issue where saving to the database wasn't creating a new modified_date --- 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); }