X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FLogging%2FReverter.php;h=61d87c6d4a3bade19ef537b481bc648024a37919;hb=832f3e1f078d2ae5fcd1ea70276f16716080af6d;hp=79ffb51a9f269d00794aca61c2765b0e431f3eb9;hpb=2845ec4b2e5fef3bf9586a8d491f02b0bb0489bb;p=civicrm-core.git diff --git a/CRM/Logging/Reverter.php b/CRM/Logging/Reverter.php index 79ffb51a9f..61d87c6d4a 100644 --- a/CRM/Logging/Reverter.php +++ b/CRM/Logging/Reverter.php @@ -1,9 +1,9 @@ diffs = $differ->diffsInTables($tables); } + /** + * Setter for diffs. + * + * @param array $diffs + */ public function setDiffs($diffs) { $this->diffs = $diffs; } @@ -195,32 +200,6 @@ class CRM_Logging_Reverter { } } - // CRM-7353: if nothing altered civicrm_contact, touch it; this will - // make sure there’s an entry in log_civicrm_contact for this revert - if (empty($diffs['civicrm_contact'])) { - $query = " - SELECT id FROM `{$this->db}`.log_civicrm_contact - WHERE log_conn_id = %1 AND log_date BETWEEN DATE_SUB(%2, INTERVAL 10 SECOND) AND DATE_ADD(%2, INTERVAL 10 SECOND) - ORDER BY log_date DESC LIMIT 1 - "; - $params = array( - 1 => array($this->log_conn_id, 'String'), - 2 => array($this->log_date, 'String'), - ); - $cid = CRM_Core_DAO::singleValueQuery($query, $params); - if (!$cid) { - return; - } - - $dao = new CRM_Contact_DAO_Contact(); - $dao->id = $cid; - if ($dao->find(TRUE)) { - // CRM-8102: MySQL can’t parse its own dates - $dao->birth_date = CRM_Utils_Date::isoToMysql($dao->birth_date); - $dao->deceased_date = CRM_Utils_Date::isoToMysql($dao->deceased_date); - $dao->save(); - } - } } }