[geeklog-cvs] geeklog: Plugin migration was only called when the plugin also n...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sun Sep 6 06:53:52 EDT 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/2b8f340f0e9f
changeset: 7287:2b8f340f0e9f
user:      Dirk Haun <dirk at haun-online.de>
date:      Sun Sep 06 11:59:29 2009 +0200
description:
Plugin migration was only called when the plugin also needed an upgrade (bug #0000947)

diffstat:

 public_html/admin/install/lib-upgrade.php |  31 ++++++++++++++++---------------
 public_html/docs/history                  |   2 ++
 2 files changed, 18 insertions(+), 15 deletions(-)

diffs (64 lines):

diff -r 5f9005f9c657 -r 2b8f340f0e9f public_html/admin/install/lib-upgrade.php
--- a/public_html/admin/install/lib-upgrade.php	Sun Sep 06 11:00:27 2009 +0200
+++ b/public_html/admin/install/lib-upgrade.php	Sun Sep 06 11:59:29 2009 +0200
@@ -806,6 +806,8 @@
 * @param    boolean $migration  whether the upgrade is part of a site migration
 * @param    array   $old_conf   old $_CONF values before the migration
 * @return   int     number of failed plugin updates (0 = everything's fine)
+* @see      PLG_upgrade
+* @see      PLG_migrate
 *
 */
 function INST_pluginUpgrades($migration = false, $old_conf = array())
@@ -820,25 +822,24 @@
     for ($i = 0; $i < $numPlugins; $i++) {
         list($pi_name, $pi_version) = DB_fetchArray($result);
 
-        $code_version = PLG_chkVersion($pi_name);
-        if (! empty($code_version) && ($code_version != $pi_version)) {
-            $success = true;
+        $success = true;
+        if ($migration) {
+            $success = PLG_migrate($pi_name, $old_conf);
+        }
 
-            if ($migration) {
-                $success = PLG_migrate($pi_name, $old_conf);
-            }
-
-            if ($success === true) {
+        if ($success === true) {
+            $code_version = PLG_chkVersion($pi_name);
+            if (! empty($code_version) && ($code_version != $pi_version)) {
                 $success = PLG_upgrade($pi_name);
             }
+        }
 
-            if ($success !== true) {
-                // upgrade failed - disable plugin
-                DB_change($_TABLES['plugins'], 'pi_enabled', 0,
-                                               'pi_name', $pi_name);
-                COM_errorLog("Upgrade for '$pi_name' plugin failed - plugin disabled");
-                $failed++;
-            }
+        if ($success !== true) {
+            // migration or upgrade failed - disable plugin
+            DB_change($_TABLES['plugins'], 'pi_enabled', 0,
+                                           'pi_name', $pi_name);
+            COM_errorLog("Migration or upgrade for '$pi_name' plugin failed - plugin disabled");
+            $failed++;
         }
     }
 
diff -r 5f9005f9c657 -r 2b8f340f0e9f public_html/docs/history
--- a/public_html/docs/history	Sun Sep 06 11:00:27 2009 +0200
+++ b/public_html/docs/history	Sun Sep 06 11:59:29 2009 +0200
@@ -3,6 +3,8 @@
 Oct ??, 2009 (1.6.1)
 ------------
 
+- Plugin migration was only called when the plugin also needed an upgrade
+  (bug #0000947) [Dirk]
 - The Migrate option in the install script now also works on an existing
   database (feature request #0000945) [Dirk]
 - Comment notifications used the phrase "Read the full article" when pointing



More information about the geeklog-cvs mailing list