From b5d0845e3744ca988952dab5aea99a6b97b136dc Mon Sep 17 00:00:00 2001 From: demeritcowboy Date: Wed, 30 Mar 2022 15:41:50 -0400 Subject: [PATCH] don't localize event_tz field when backing up --- CRM/Upgrade/Incremental/php/TimezoneRevertTrait.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CRM/Upgrade/Incremental/php/TimezoneRevertTrait.php b/CRM/Upgrade/Incremental/php/TimezoneRevertTrait.php index f27d734fbc..418f7d3c49 100644 --- a/CRM/Upgrade/Incremental/php/TimezoneRevertTrait.php +++ b/CRM/Upgrade/Incremental/php/TimezoneRevertTrait.php @@ -94,7 +94,13 @@ trait CRM_Upgrade_Incremental_php_TimezoneRevertTrait { public static function fillBackupEventDates(CRM_Queue_TaskContext $ctx): bool { // We only run if the field is timestamp, so don't need to check about that. CRM_Core_DAO::executeQuery('UPDATE civicrm_event SET start_date_ts_bak = start_date, end_date_ts_bak = end_date, registration_start_date_ts_bak = registration_start_date, registration_end_date_ts_bak = registration_end_date'); - CRM_Core_DAO::executeQuery("ALTER TABLE civicrm_event CHANGE COLUMN event_tz event_tz_bak text NULL DEFAULT NULL COMMENT 'For troubleshooting upgrades post 5.47. Can drop this column if no issues.'"); + // don't try to localize since original was not localizable + CRM_Core_DAO::executeQuery("ALTER TABLE civicrm_event CHANGE COLUMN event_tz event_tz_bak text NULL DEFAULT NULL COMMENT 'For troubleshooting upgrades post 5.47. Can drop this column if no issues.'", [], TRUE, NULL, FALSE, FALSE); + // need to rebuild since otherwise view is out of date + $locales = CRM_Core_I18n::getMultilingual(); + if ($locales) { + CRM_Core_I18n_Schema::rebuildMultilingualSchema($locales, NULL, TRUE); + } return TRUE; } -- 2.25.1