<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.7 |
+ | CiviCRM version 5 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2018 |
+--------------------------------------------------------------------+
$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) {
$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;
}
}