X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FLogging%2FSchema.php;h=72c8322a565ffa91c6beb76a1fd71268c403ec3e;hb=4e0d128b6500bf07e7cdd4037b0b28a205399904;hp=98bec45c62b5c6a78fc3da5cb3146bf1adfe606d;hpb=8d0350deb1e7e50d43d23e55dcfc6bcab335cd21;p=civicrm-core.git diff --git a/CRM/Logging/Schema.php b/CRM/Logging/Schema.php index 98bec45c62..72c8322a56 100644 --- a/CRM/Logging/Schema.php +++ b/CRM/Logging/Schema.php @@ -430,12 +430,10 @@ AND (TABLE_NAME LIKE 'log_civicrm_%' $nonStandardTableNameString ) * name of the relevant table. * @param array $cols * Mixed array of columns to add or null (to check for the missing columns). - * @param bool $rebuildTrigger - * should we rebuild the triggers. * * @return bool */ - public function fixSchemaDifferencesFor($table, $cols = [], $rebuildTrigger = FALSE) { + public function fixSchemaDifferencesFor($table, $cols = []) { if (empty($table)) { return FALSE; } @@ -469,10 +467,6 @@ AND (TABLE_NAME LIKE 'log_civicrm_%' $nonStandardTableNameString ) } } - if ($rebuildTrigger) { - // invoke the meta trigger creation call - CRM_Core_DAO::triggerRebuild($table); - } return TRUE; } @@ -523,7 +517,7 @@ AND (TABLE_NAME LIKE 'log_civicrm_%' $nonStandardTableNameString ) } foreach ($diffs as $table => $cols) { - $this->fixSchemaDifferencesFor($table, $cols, FALSE); + $this->fixSchemaDifferencesFor($table, $cols); } if ($rebuildTrigger) { // invoke the meta trigger creation call @@ -603,7 +597,7 @@ AND (TABLE_NAME LIKE 'log_civicrm_%' $nonStandardTableNameString ) } \Civi::$statics[__CLASS__]['columnsOf'][$table] = []; while ($dao->fetch()) { - \Civi::$statics[__CLASS__]['columnsOf'][$table][] = CRM_Utils_type::escape($dao->Field, 'MysqlColumnNameOrAlias'); + \Civi::$statics[__CLASS__]['columnsOf'][$table][] = CRM_Utils_Type::escape($dao->Field, 'MysqlColumnNameOrAlias'); } } return \Civi::$statics[__CLASS__]['columnsOf'][$table]; @@ -919,6 +913,13 @@ COLS; // logging is enabled, so now lets create the trigger info tables foreach ($tableNames as $table) { + if (!isset($this->logTableSpec[$table])) { + // Per testIgnoreCustomTableByHook this would be unset if a hook had + // intervened to prevent logging / triggers on this table. + // This could go to the extent of blocking the updates to 'modified_date' + // which makes sense, in particular, for calculated fields. + continue; + } $columns = $this->columnsOf($table, $force); // only do the change if any data has changed