Unverified Commit eda4db78 authored by eileen's avatar eileen 🎱 Committed by GitHub

Merge pull request #11829 from eileenmcnaughton/rules

Fix regression on CiviRules search due to exception handling
parents b0ec8567 4caab828
......@@ -1029,7 +1029,10 @@ SELECT DISTINCT 'civicrm_contact', contact_a.id, contact_a.id, '$cacheKey', cont
$sql = str_replace(array("SELECT contact_a.id as contact_id", "SELECT contact_a.id as id"), $insertSQL, $sql);
try {
CRM_Core_DAO::executeQuery($sql);
$result = CRM_Core_DAO::executeQuery($sql, [], FALSE, NULL, FALSE, TRUE, TRUE);
if (is_a($result, 'DB_Error')) {
throw new CRM_Core_Exception($result->message);
}
}
catch (CRM_Core_Exception $e) {
if ($coreSearch) {
......@@ -1038,7 +1041,10 @@ SELECT DISTINCT 'civicrm_contact', contact_a.id, contact_a.id, '$cacheKey', cont
$this->rebuildPreNextCache($start, $end, $sort, $cacheKey);
}
else {
CRM_Core_Session::setStatus(ts('Query Failed'));
// This will always show for CiviRules :-( as a) it orders by 'rule_label'
// which is not available in the query & b) it uses contact not contact_a
// as an alias.
// CRM_Core_Session::setStatus(ts('Query Failed'));
return;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment