Skip to content
Open
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
10 changes: 6 additions & 4 deletions sumfields.php
Original file line number Diff line number Diff line change
Expand Up @@ -447,10 +447,10 @@ function sumfields_generate_data_based_on_current_data($session = NULL) {
// disableLoggingForThisConnection() checks the config for logging
CRM_Logging_Schema::disableLoggingForThisConnection();

// In theory we shouldn't have to truncate the table, but we
// In theory we shouldn't have to delete the records, but we
// are doing it just to be sure it's empty.
$sql = "TRUNCATE TABLE `$table_name`";
$dao = CRM_Core_DAO::executeQuery($sql);
$sql = "DELETE FROM `$table_name`";
CRM_Core_DAO::executeQuery($sql);

// Load the field and group definitions because we need the trigger
// clause that is stored here. These are the generically shipped
Expand Down Expand Up @@ -1340,7 +1340,9 @@ function sumfields_gen_data(&$returnValues) {
}
if(!$exception) {
if(sumfields_generate_data_based_on_current_data()) {
CRM_Core_DAO::triggerRebuild();
if ($new_active_fields) {
CRM_Core_DAO::triggerRebuild();
}
$date = date('Y-m-d H:i:s');
if ($data_update_method == 'via_cron') {
// If we have big data, then after a successful task, re-set the status to scheduled
Expand Down