Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get log date from tables available in query with data instead of last table #18868

Merged
merged 1 commit into from
Nov 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CRM/Logging/Differ.php
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,8 @@ public function getAllChangesForConnection($tables) {
$dao = CRM_Core_DAO::executeQuery($sql, $params);
while ($dao->fetch()) {
if (empty($this->log_date)) {
$this->log_date = CRM_Core_DAO::singleValueQuery("SELECT log_date FROM {$this->db}.log_{$table} WHERE log_conn_id = %1 LIMIT 1", $params);
// look for available table in above query instead of looking for last table. this will avoid multiple loops
$this->log_date = CRM_Core_DAO::singleValueQuery("SELECT log_date FROM {$this->db}.log_{$dao->table_name} WHERE log_conn_id = %1 LIMIT 1", $params);
}
$diffs = array_merge($diffs, $this->diffsInTableForId($dao->table_name, $dao->id));
}
Expand Down