CRM-12549 - Restore upgrade message
authorTim Otten <totten@civicrm.org>
Tue, 7 May 2013 22:22:04 +0000 (15:22 -0700)
committerTim Otten <totten@civicrm.org>
Tue, 7 May 2013 22:22:04 +0000 (15:22 -0700)
----------------------------------------
* CRM-12549: Upgrade isn't displaying $message on success.tpl
  http://issues.civicrm.org/jira/browse/CRM-12549

CRM/Upgrade/Page/Upgrade.php

index bdac1700845fab18efc8ccc533fad8c8fea25dc2..444862849654cc8c9fbb3b30cc673688704515cb 100644 (file)
@@ -150,6 +150,8 @@ class CRM_Upgrade_Page_Upgrade extends CRM_Core_Page {
     // lets drop all the triggers here
     CRM_Core_DAO::dropTriggers();
 
+    $this->set('isUpgradePending', TRUE);
+
     // Persistent message storage across upgrade steps. TODO: Use structured message store
     // Note: In clustered deployments, this file must be accessible by all web-workers.
     $this->set('postUpgradeMessageFile', CRM_Utils_File::tempnam('civicrm-post-upgrade'));
@@ -174,8 +176,9 @@ class CRM_Upgrade_Page_Upgrade extends CRM_Core_Page {
     $upgrade = new CRM_Upgrade_Form();
     $template = CRM_Core_Smarty::singleton();
 
-    list($currentVer, $latestVer) = $upgrade->getUpgradeVersions();
-    if ($currentVer != $latestVer) {
+    // If we're redirected from queue-runner, then isUpgradePending=true.
+    // If user then reloads the finish page, the isUpgradePending will be unset. (Because the session has been cleared.)
+    if ($this->get('isUpgradePending')) {
       // TODO: Use structured message store
       $postUpgradeMessage = file_get_contents($this->get('postUpgradeMessageFile'));