Commit b53879dd763db4ea356b40f6fa72ecc1d543a420

Authored by kevin_fourie
1 parent 894f64ac

KTS-2799

"3.5.2 beta 2 upgrade error"
Updated. Updated the persistent actions methods. This needs to be done properly if it works.

Committed By: Kevin Fourie
Reviewed By: Jonathan Byrne

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7994 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 43 additions and 3 deletions
setup/upgrade.php
... ... @@ -123,7 +123,16 @@ function performAllUpgrades () {
123 123 return $res;
124 124 }
125 125  
126   -function performPersistentActions() {
  126 +function performPreUpgradeActions() {
  127 +
  128 + // This is just to test and needs to be updated to a more sane and error resistent architrcture if it works.
  129 + // It should idealy work the same as the upgrades.
  130 +
  131 + return true;
  132 +
  133 +}
  134 +
  135 +function performPostUpgradeActions() {
127 136  
128 137 // This is just to test and needs to be updated to a more sane and error resistent architrcture if it works.
129 138 // It should idealy work the same as the upgrades.
... ... @@ -1063,8 +1072,24 @@ function Upgrade()
1063 1072 upgrade your <?php echo APP_NAME;?> installation to <strong><?php echo $default->systemVersion;?></strong>.
1064 1073  
1065 1074 <?php
  1075 + $pre_res = performPreUpgradeActions();
  1076 + if (PEAR::isError($pre_res))
  1077 + {
  1078 +?>
  1079 +<font color="red">Pre-Upgrade actions failed.</font>
  1080 +<?php
  1081 + }
  1082 + else
  1083 + {
  1084 +?>
  1085 +<p>
  1086 +<font color="green">Pre-Upgrade actions succeeded.</font>
  1087 +<?php
  1088 + }
  1089 +?>
  1090 +<p>
  1091 + <?php
1066 1092 $res = performAllUpgrades();
1067   - $pres = performPersistentActions();
1068 1093 if (PEAR::isError($res) || PEAR::isError($pres))
1069 1094 {
1070 1095 ?>
... ... @@ -1073,7 +1098,6 @@ function Upgrade()
1073 1098 }
1074 1099 else
1075 1100 {
1076   -
1077 1101 ?>
1078 1102 <p>
1079 1103 <font color="green">Upgrade succeeded.</font>
... ... @@ -1081,6 +1105,22 @@ function Upgrade()
1081 1105 }
1082 1106 ?>
1083 1107 <p>
  1108 + <?php
  1109 + $post_pres = performPostUpgradeActions();
  1110 + if (PEAR::isError($post_res))
  1111 + {
  1112 +?>
  1113 +<font color="red">Post-Upgrade actions failed.</font>
  1114 +<?php
  1115 + }
  1116 + else
  1117 + {
  1118 +?>
  1119 +<p>
  1120 +<font color="green">Post-Upgrade actions succeeded.</font>
  1121 +<?php
  1122 + }
  1123 +?>
1084 1124  
1085 1125 &nbsp;&nbsp; &nbsp; &nbsp; <input type=button value="back" onclick="javascript:do_start('home')">
1086 1126 &nbsp;&nbsp; &nbsp; &nbsp; <input type=button value="next" onclick="javascript:document.location='..';">
... ...