From: Seamus Lee Date: Fri, 13 Aug 2021 22:09:18 +0000 (+1000) Subject: dev/core#1618 Trigger a reconciliation of logging tables after Extension upgrades... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2bbbd9b28a94c93cfe0aee25bfca1f3da69bec23;p=civicrm-core.git dev/core#1618 Trigger a reconciliation of logging tables after Extension upgrades have been done to ensure any new columns are correctly added to logging tables as well Update PR as per comments from Dave D --- diff --git a/CRM/Extension/Upgrades.php b/CRM/Extension/Upgrades.php index d26a266ff6..adf3b1f494 100644 --- a/CRM/Extension/Upgrades.php +++ b/CRM/Extension/Upgrades.php @@ -69,9 +69,27 @@ class CRM_Extension_Upgrades { CRM_Utils_Hook::upgrade('enqueue', $queue); + // dev/core#1618 When Extension Upgrades are run reconcile log tables + $task = new CRM_Queue_Task( + [__CLASS__, 'upgradeLogTables'], + [], + ts('Update log tables') + ); + // Set weight low so that it will be run last. + $queue->createItem($task, -2); + return $queue; } + /** + * Update log tables following execution of extension upgrades + */ + public static function upgradeLogTables() { + $logging = new CRM_Logging_Schema(); + $logging->fixSchemaDifferences(); + return TRUE; + } + /** * @return array * Array(string $extKey => CRM_Extension_Upgrader_Interface $upgrader)