* @param $latestVer
*/
public function setPreUpgradeMessage(&$preUpgradeMessage, $currentVer, $latestVer) {
- CRM_Upgrade_Incremental_Legacy::setPreUpgradeMessage($preUpgradeMessage, $currentVer, $latestVer);
+ // check for changed message templates
+ CRM_Upgrade_Incremental_General::checkMessageTemplate($preUpgradeMessage, $latestVer, $currentVer);
+ // set global messages
+ CRM_Upgrade_Incremental_General::setPreUpgradeMessage($preUpgradeMessage, $currentVer, $latestVer);
// Scan through all php files and see if any file is interested in setting pre-upgrade-message
// based on $currentVer, $latestVer.
// Please note, at this point upgrade hasn't started executing queries.
$revisions = $this->getRevisionSequence();
foreach ($revisions as $rev) {
- if (version_compare($currentVer, $rev) < 0 &&
- version_compare($rev, '3.2.alpha1') > 0
- ) {
+ if (version_compare($currentVer, $rev) < 0) {
$versionObject = $this->incrementalPhpObject($rev);
- if (is_callable(array(
- $versionObject,
- 'setPreUpgradeMessage',
- ))) {
+ if (is_callable(array($versionObject, 'setPreUpgradeMessage'))) {
$versionObject->setPreUpgradeMessage($preUpgradeMessage, $rev, $currentVer);
}
}
*/
/**
- * This class is a container for legacy upgrade logic which predates
- * the current 'CRM/Incremental/php/*' structure.
+ * This class contains generic upgrade logic which runs regardless of version.
*/
-class CRM_Upgrade_Incremental_Legacy {
+class CRM_Upgrade_Incremental_General {
/**
* Compute any messages which should be displayed before upgrade.
* @param $latestVer
*/
public static function setPreUpgradeMessage(&$preUpgradeMessage, $currentVer, $latestVer) {
- $upgrade = new CRM_Upgrade_Form();
- $template = CRM_Core_Smarty::singleton();
-
- // check for changed message templates
- self::checkMessageTemplate($template, $preUpgradeMessage, $latestVer, $currentVer);
-
// http://issues.civicrm.org/jira/browse/CRM-13572
// Depending on how the code was upgraded, some sites may still have copies of old
// source files left behind. This is often a forgivable offense, but it's quite
}
/**
- * @param $template
* @param $message
* @param $latestVer
* @param $currentVer
*/
- public static function checkMessageTemplate(&$template, &$message, $latestVer, $currentVer) {
+ public static function checkMessageTemplate(&$message, $latestVer, $currentVer) {
$sql = "SELECT orig.workflow_id as workflow_id,
orig.msg_title as title
)
)";
- $dao = &CRM_Core_DAO::executeQuery($sql);
+ $dao = CRM_Core_DAO::executeQuery($sql);
while ($dao->fetch()) {
$workflows[$dao->workflow_id] = $dao->title;
}