From 8221ad74b3ad30bd4427ec43f49bb648cb482710 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 12 Apr 2023 10:34:40 -0400 Subject: [PATCH] Remove references to CRM_Upgrade_Incremental_php_FourSeven class --- CRM/Upgrade/Incremental/Base.php | 2 -- Civi/Core/SettingsBag.php | 15 +-------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/CRM/Upgrade/Incremental/Base.php b/CRM/Upgrade/Incremental/Base.php index 4171e4b5dc..75ffcb9708 100644 --- a/CRM/Upgrade/Incremental/Base.php +++ b/CRM/Upgrade/Incremental/Base.php @@ -76,7 +76,6 @@ class CRM_Upgrade_Incremental_Base { * This method will be invoked multiple times. Implementations MUST consult the `$rev` * before deciding what messages to add. See the examples linked below. * - * @see \CRM_Upgrade_Incremental_php_FourSeven::setPreUpgradeMessage() * @see \CRM_Upgrade_Incremental_php_FiveTwenty::setPreUpgradeMessage() * * @param string $preUpgradeMessage @@ -101,7 +100,6 @@ class CRM_Upgrade_Incremental_Base { * This method will be invoked multiple times. Implementations MUST consult the `$rev` * before deciding what messages to add. See the examples linked below. * - * @see \CRM_Upgrade_Incremental_php_FourSeven::setPostUpgradeMessage() * @see \CRM_Upgrade_Incremental_php_FiveTwentyOne::setPostUpgradeMessage() * * @param string $postUpgradeMessage diff --git a/Civi/Core/SettingsBag.php b/Civi/Core/SettingsBag.php index be51cc6ae4..0c69538dbc 100644 --- a/Civi/Core/SettingsBag.php +++ b/Civi/Core/SettingsBag.php @@ -115,22 +115,9 @@ class SettingsBag { $this->values = []; $this->combined = NULL; - // Ordinarily, we just load values from `civicrm_setting`. But upgrades require care. - // In v4.0 and earlier, all values were stored in `civicrm_domain.config_backend`. - // In v4.1-v4.6, values were split between `civicrm_domain` and `civicrm_setting`. - // In v4.7+, all values are stored in `civicrm_setting`. - // Whenever a value is available in civicrm_setting, it will take precedence. - $isUpgradeMode = \CRM_Core_Config::isUpgradeMode(); - if ($isUpgradeMode && empty($this->contactId) && \CRM_Core_BAO_SchemaHandler::checkIfFieldExists('civicrm_domain', 'config_backend', FALSE)) { - $config_backend = \CRM_Core_DAO::singleValueQuery('SELECT config_backend FROM civicrm_domain WHERE id = %1', - [1 => [$this->domainId, 'Positive']]); - $oldSettings = \CRM_Upgrade_Incremental_php_FourSeven::convertBackendToSettings($this->domainId, $config_backend); - \CRM_Utils_Array::extend($this->values, $oldSettings); - } - - // Normal case. Aside: Short-circuit prevents unnecessary query. + // Only query table if it exists. if (!$isUpgradeMode || \CRM_Core_DAO::checkTableExists('civicrm_setting')) { $dao = \CRM_Core_DAO::executeQuery($this->createQuery()->toSQL()); while ($dao->fetch()) { -- 2.25.1