From a40fd1acaaa25ef5a4fef017a3e3b63768a8b4f5 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 8 Oct 2015 12:56:59 -0400 Subject: [PATCH] CRM-17004 - Fix upgrade order --- CRM/Upgrade/Incremental/php/FourSeven.php | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/CRM/Upgrade/Incremental/php/FourSeven.php b/CRM/Upgrade/Incremental/php/FourSeven.php index 5d9798c177..8382fdfe02 100644 --- a/CRM/Upgrade/Incremental/php/FourSeven.php +++ b/CRM/Upgrade/Incremental/php/FourSeven.php @@ -44,18 +44,19 @@ class CRM_Upgrade_Incremental_php_FourSeven extends CRM_Upgrade_Incremental_Base */ public function setPreUpgradeMessage(&$preUpgradeMessage, $rev, $currentVer = NULL) { if ($rev == '4.7.alpha1') { - // CRM-17004 Warn of Moneris removal - $monerisProcessors = civicrm_api3('PaymentProcessor', 'getcount', array('payment_processor_type_id' => "Moneris")); - if (!empty($monerisProcessors['result']) && !function_exists('moneris_civicrm_managed')) { - $preUpgradeMessage .= '

' . ts('The %1 payment processor is no longer bundled with CiviCRM. After upgrading you will need to install the extension to continue using it.', array(1 => 'Moneris')) . '

'; - } - // CRM-16478 Remove custom fatal error template path option $config = CRM_Core_Config::singleton(); if (!empty($config->fatalErrorTemplate) && $config->fatalErrorTemplate != 'CRM/common/fatal.tpl') { $preUpgradeMessage .= '

' . ts('The custom fatal error template setting will be removed during the upgrade. You are currently using this custom template: %1 . Following the upgrade you will need to use the standard approach to overriding template files, as described in the documentation.', array(1 => $config->fatalErrorTemplate)) . '

'; } } + if ($rev == '4.7.alpha4') { + // CRM-17004 Warn of Moneris removal + $monerisProcessors = civicrm_api3('PaymentProcessor', 'getcount', array('payment_processor_type_id' => "Moneris")); + if (!empty($monerisProcessors['result']) && !function_exists('moneris_civicrm_managed')) { + $preUpgradeMessage .= '

' . ts('The %1 payment processor is no longer bundled with CiviCRM. After upgrading you will need to install the extension to continue using it.', array(1 => 'Moneris')) . '

'; + } + } } /** @@ -109,6 +110,15 @@ class CRM_Upgrade_Incremental_php_FourSeven extends CRM_Upgrade_Incremental_Base $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => $rev)), 'runSql', $rev); $this->addTask(ts('Migrate Settings to %1', array(1 => $rev)), 'migrateSettings', $rev); $this->addTask(ts('Add Getting Started dashlet to %1: SQL', array(1 => $rev)), 'addGettingStartedDashlet', $rev); + } + + /** + * Upgrade function. + * + * @param string $rev + */ + public function upgrade_4_7_alpha4($rev) { + $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => $rev)), 'runSql', $rev); $this->addTask(ts('Remove %1', array(1 => 'Moneris')), 'removePaymentProcessorType', 'Moneris'); } -- 2.25.1