Skip to content

Commit

Permalink
CRM-20892 Fix issue where saving to the database wasn't creating a ne…
Browse files Browse the repository at this point in the history
…w modified_date
  • Loading branch information
seamuslee001 committed Sep 11, 2017
1 parent e7a6eae commit 56944d3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion CRM/Mailing/BAO/Mailing.php
Original file line number Diff line number Diff line change
Expand Up @@ -1600,11 +1600,19 @@ public static function add(&$params, $ids = array()) {
) {
$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);
}
Expand Down

0 comments on commit 56944d3

Please sign in to comment.