From a40a5a4875bf5caa03eaa8732c958f5c714c7b61 Mon Sep 17 00:00:00 2001 From: Camilo Rodriguez Date: Fri, 1 Nov 2019 15:03:39 +0000 Subject: [PATCH] dev/core#1360: Fix Programatic Installation Of Multiple Extensions --- CRM/Logging/Schema.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CRM/Logging/Schema.php b/CRM/Logging/Schema.php index 72c8322a56..ea6da26505 100644 --- a/CRM/Logging/Schema.php +++ b/CRM/Logging/Schema.php @@ -507,6 +507,8 @@ AND (TABLE_NAME LIKE 'log_civicrm_%' $nonStandardTableNameString ) */ public function fixSchemaDifferencesForAll($rebuildTrigger = FALSE) { $diffs = []; + $this->resetTableColumnsCache(); + foreach ($this->tables as $table) { if (empty($this->logs[$table])) { $this->createLogTableFor($table); @@ -525,6 +527,17 @@ AND (TABLE_NAME LIKE 'log_civicrm_%' $nonStandardTableNameString ) } } + /** + * Resets columnSpecs. + * + * Resets columnSpecs static array in Civi's $statics to make sure we use the + * real state of the schema to perform sync operations between core and + * logging tables. + */ + private function resetTableColumnsCache() { + unset(\Civi::$statics[__CLASS__]['columnSpecs']); + } + /** * Fix timestamp. * -- 2.25.1