[geeklog-cvs] geeklog: Second batch of fixes for bug #0001354: Upgrading from ...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sun May 29 13:19:53 EDT 2011


changeset 8295:6dcd3e4fe59a
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/6dcd3e4fe59a
user: Dirk Haun <dirk at haun-online.de>
date: Sun May 29 18:00:00 2011 +0200
description:
Second batch of fixes for bug #0001354: Upgrading from a pre-1.5.0 Geeklog version will result in an up-to-date plugin Configuration, so skip any later updates

diffstat:

 plugins/calendar/functions.inc            |  18 +++++++++++-------
 plugins/links/functions.inc               |   8 ++++++--
 plugins/polls/functions.inc               |  16 ++++++++++++----
 plugins/polls/sql/mssql_updates.php       |   4 ++--
 plugins/polls/sql/mysql_updates.php       |   4 ++--
 plugins/spamx/functions.inc               |  20 ++++++++++++--------
 plugins/staticpages/functions.inc         |  26 +++++++++++++++++---------
 plugins/staticpages/sql/mssql_updates.php |   4 ++--
 plugins/staticpages/sql/mysql_updates.php |   2 +-
 plugins/staticpages/sql/pgsql_updates.php |   4 ++--
 10 files changed, 67 insertions(+), 39 deletions(-)

diffs (truncated from 365 to 300 lines):

diff -r 671c7abaa779 -r 6dcd3e4fe59a plugins/calendar/functions.inc
--- a/plugins/calendar/functions.inc	Sun May 29 17:20:11 2011 +0200
+++ b/plugins/calendar/functions.inc	Sun May 29 18:00:00 2011 +0200
@@ -1520,11 +1520,12 @@
 
     require_once $_CONF['path'] . 'plugins/calendar/sql/'
                                 . $_DB_dbms . '_updates.php';
-                                
-    require_once $_CONF['path'] . 'plugins/calendar/install_updates.php';                                   
+
+    require_once $_CONF['path'] . 'plugins/calendar/install_updates.php';
 
     $current_version = $installed_version;
     $done = false;
+    $current_config = false;
     while (! $done) {
         switch ($current_version) {
         case '1.0.0':
@@ -1551,6 +1552,7 @@
                 }
             }
             calendar_update_move_states();
+            $current_config = true;
 
             $current_version = '1.0.2';
             break;
@@ -1583,13 +1585,15 @@
                     DB_query($sql);
                 }
             }
-            
-            calendar_update_ConfValues_1_1_1();
-            
-            calendar_update_ConfigSecurity_1_1_1();
+
+            if (! $current_config) {
+                calendar_update_ConfValues_1_1_1();
+
+                calendar_update_ConfigSecurity_1_1_1();
+            }
 
             $current_version = '1.1.2';
-            break;            
+            break;
 
         default:
             $done = true;
diff -r 671c7abaa779 -r 6dcd3e4fe59a plugins/links/functions.inc
--- a/plugins/links/functions.inc	Sun May 29 17:20:11 2011 +0200
+++ b/plugins/links/functions.inc	Sun May 29 18:00:00 2011 +0200
@@ -694,6 +694,7 @@
 
     $current_version = $installed_version;
     $done = false;
+    $current_config = false;
     while (! $done) {
         switch ($current_version) {
         case '1.0.1':
@@ -724,6 +725,7 @@
                 }
             }
             links_update_set_categories();
+            $current_config = true;
 
             $current_version = '2.0.0';
             break;
@@ -757,9 +759,11 @@
                 }
             }
 
-            links_update_ConfValues_2_1_0();
+            if (! $current_config) {
+                links_update_ConfValues_2_1_0();
 
-            links_update_ConfigSecurity_2_1_0();
+                links_update_ConfigSecurity_2_1_0();
+            }
 
             $current_version = '2.1.1';
             break;
diff -r 671c7abaa779 -r 6dcd3e4fe59a plugins/polls/functions.inc
--- a/plugins/polls/functions.inc	Sun May 29 17:20:11 2011 +0200
+++ b/plugins/polls/functions.inc	Sun May 29 18:00:00 2011 +0200
@@ -1154,6 +1154,7 @@
 
     $current_version = $installed_version;
     $done = false;
+    $current_config = false;
     while (! $done) {
         switch ($current_version) {
         case '1.1.0':
@@ -1182,6 +1183,7 @@
                 }
             }
             polls_update_polltopics();
+            $current_config = true;
 
             $current_version = '2.0.1';
             break;
@@ -1204,7 +1206,9 @@
                 }
             }
 
-            update_ConfValues_2_1_0();
+            if (! $current_config) {
+                polls_update_ConfValues_2_1_0();
+            }
 
             $current_version = '2.1.1';
             break;
@@ -1217,7 +1221,9 @@
                 }
             }
 
-            update_ConfValues_2_1_1();
+            if (! $current_config) {
+                polls_update_ConfValues_2_1_1();
+            }
 
             $current_version = '2.1.2';
             break;
@@ -1230,9 +1236,11 @@
                 }
             }
 
-            polls_update_ConfValues_2_1_2();
+            if (! $current_config) {
+                polls_update_ConfValues_2_1_2();
 
-            polls_update_ConfigSecurity_2_1_2();
+                polls_update_ConfigSecurity_2_1_2();
+            }
 
             $current_version = '2.1.3';
             break;
diff -r 671c7abaa779 -r 6dcd3e4fe59a plugins/polls/sql/mssql_updates.php
--- a/plugins/polls/sql/mssql_updates.php	Sun May 29 17:20:11 2011 +0200
+++ b/plugins/polls/sql/mssql_updates.php	Sun May 29 18:00:00 2011 +0200
@@ -96,7 +96,7 @@
 
 }
 
-function update_ConfValues_2_1_0()
+function polls_update_ConfValues_2_1_0()
 {
     global $_CONF, $_PO_DEFAULT;
 
@@ -111,7 +111,7 @@
     return true;
 }
 
-function update_ConfValues_2_1_1()
+function polls_update_ConfValues_2_1_1()
 {
     global $_CONF, $_PO_DEFAULT, $_PO_CONF;
 
diff -r 671c7abaa779 -r 6dcd3e4fe59a plugins/polls/sql/mysql_updates.php
--- a/plugins/polls/sql/mysql_updates.php	Sun May 29 17:20:11 2011 +0200
+++ b/plugins/polls/sql/mysql_updates.php	Sun May 29 18:00:00 2011 +0200
@@ -144,7 +144,7 @@
 
 }
 
-function update_ConfValues_2_1_0()
+function polls_update_ConfValues_2_1_0()
 {
     global $_CONF, $_PO_DEFAULT;
 
@@ -159,7 +159,7 @@
     return true;
 }
 
-function update_ConfValues_2_1_1()
+function polls_update_ConfValues_2_1_1()
 {
     global $_CONF, $_PO_DEFAULT, $_PO_CONF;
 
diff -r 671c7abaa779 -r 6dcd3e4fe59a plugins/spamx/functions.inc
--- a/plugins/spamx/functions.inc	Sun May 29 17:20:11 2011 +0200
+++ b/plugins/spamx/functions.inc	Sun May 29 18:00:00 2011 +0200
@@ -185,14 +185,15 @@
 
     $inst_parms = plugin_autoinstall_spamx('spamx');
     $pi_gl_version = $inst_parms['info']['pi_gl_version'];
-    
+
     require_once $_CONF['path'] . 'plugins/spamx/sql/'
                                 . $_DB_dbms . '_updates.php';
-                                
-    require_once $_CONF['path'] . 'plugins/spamx/install_updates.php';  
+
+    require_once $_CONF['path'] . 'plugins/spamx/install_updates.php';
 
     $current_version = $installed_version;
     $done = false;
+    $current_config = false;
     while (! $done) {
         switch ($current_version) {
         case '1.1.0':
@@ -211,6 +212,7 @@
                 echo 'There was an error upgrading the Spam-X plugin';
                 return false;
             }
+            $current_config = true;
 
             $current_version = '1.1.1';
             break;
@@ -249,7 +251,7 @@
 
             $current_version = '1.2.1';
             break;
-            
+
         case '1.2.1':
             if (isset($_UPDATES[$current_version])) {
                 $_SQL = $_UPDATES[$current_version];
@@ -258,10 +260,12 @@
                 }
             }            
 
-            spamx_update_ConfValues_1_2_1();  
-            
-            spamx_update_ConfigSecurity_1_2_1();
-            
+            if (! $current_config) {
+                spamx_update_ConfValues_1_2_1();  
+
+                spamx_update_ConfigSecurity_1_2_1();
+            }
+
             $current_version = '1.2.2';
             break;
 
diff -r 671c7abaa779 -r 6dcd3e4fe59a plugins/staticpages/functions.inc
--- a/plugins/staticpages/functions.inc	Sun May 29 17:20:11 2011 +0200
+++ b/plugins/staticpages/functions.inc	Sun May 29 18:00:00 2011 +0200
@@ -10,7 +10,7 @@
 // | API method and 2) implements all the common code needed by the Static     |
 // | Pages' PHP files.                                                         |
 // +---------------------------------------------------------------------------+
-// | Copyright (C) 2000-2010 by the following authors:                         |
+// | Copyright (C) 2000-2011 by the following authors:                         |
 // |                                                                           |
 // | Authors: Tony Bibbs       - tony AT tonybibbs DOT com                     |
 // |          Tom Willett      - twillett AT users DOT sourceforge DOT net     |
@@ -1236,11 +1236,12 @@
 
     require_once $_CONF['path'] . 'plugins/staticpages/sql/'
                                 . $_DB_dbms . '_updates.php';
-                                
+
     require_once $_CONF['path'] . 'plugins/staticpages/install_updates.php';   
 
     $current_version = $installed_version;
     $done = false;
+    $current_config = false;
     while (! $done) {
         switch ($current_version) {
         case '1.4.3':
@@ -1266,6 +1267,7 @@
                     DB_query($sql);
                 }
             }
+            $current_config = true;
 
             $current_version = '1.5.0';
             break;
@@ -1288,7 +1290,9 @@
                 }
             }
 
-            SP_update_ConfValues_1_6_0();
+            if (! $current_config) {
+                SP_update_ConfValues_1_6_0();
+            }
 
             $current_version = '1.6.1';
             break;
@@ -1301,11 +1305,13 @@
                 }
             }
 
-            SP_update_ConfValues_1_6_1();
+            if (! $current_config) {
+                SP_update_ConfValues_1_6_1();
+            }
 
             $current_version = '1.6.2';
             break;
-            
+
         case '1.6.2':
             if (isset($_UPDATES[$current_version])) {
                 $_SQL = $_UPDATES[$current_version];
@@ -1324,10 +1330,12 @@
                     DB_query($sql);
                 }
             }
-            
-            SP_update_ConfValues_1_6_3();



More information about the geeklog-cvs mailing list