Skip to content
Snippets Groups Projects
Commit cded6e48 authored by totten's avatar totten
Browse files

CRM-13085 - Fix premature transaction commit stemming from TRUNCATE TABLE civicrm_acl_contact_cache

----------------------------------------
* CRM-13085: Transaction rollback doesn't work with contact creation (due to ACL TRUNCATE)
  http://issues.civicrm.org/jira/browse/CRM-13085
parent 792ad554
Branches
Tags
No related merge requests found
......@@ -140,7 +140,15 @@ WHERE modified_date IS NULL
";
CRM_Core_DAO::singleValueQuery($query);
CRM_Core_DAO::singleValueQuery("TRUNCATE TABLE civicrm_acl_contact_cache");
// CRM_Core_DAO::singleValueQuery("TRUNCATE TABLE civicrm_acl_contact_cache"); // No, force-commits transaction
// CRM_Core_DAO::singleValueQuery("DELETE FROM civicrm_acl_contact_cache"); // Transaction-safe
if (CRM_Core_Transaction::isActive()) {
CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_POST_COMMIT, function(){
CRM_Core_DAO::singleValueQuery("TRUNCATE TABLE civicrm_acl_contact_cache");
});
} else {
CRM_Core_DAO::singleValueQuery("TRUNCATE TABLE civicrm_acl_contact_cache");
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment