[geeklog-cvs] geeklog: Since PLG_migrate is called before PLG_upgrade, gracefu...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sun May 29 10:15:27 EDT 2011


changeset 8291:5f979a64a87d
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/5f979a64a87d
user: Dirk Haun <dirk at haun-online.de>
date: Sun May 29 10:46:34 2011 +0200
description:
Since PLG_migrate is called before PLG_upgrade, gracefully skip migration of non-existent tables (related to bug #0001354)

diffstat:

 public_html/admin/install/migrate.php |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r 97c8d884d6f8 -r 5f979a64a87d public_html/admin/install/migrate.php
--- a/public_html/admin/install/migrate.php	Sun May 29 09:42:06 2011 +0200
+++ b/public_html/admin/install/migrate.php	Sun May 29 10:46:34 2011 +0200
@@ -2,13 +2,13 @@
 
 /* Reminder: always indent with 4 spaces (no tabs). */
 // +---------------------------------------------------------------------------+
-// | Geeklog 1.6                                                               |
+// | Geeklog 1.8                                                               |
 // +---------------------------------------------------------------------------+
 // | migrate.php                                                               |
 // |                                                                           |
 // | Install Geeklog from a backup.                                            |
 // +---------------------------------------------------------------------------+
-// | Copyright (C) 2008-2009 by the following authors:                         |
+// | Copyright (C) 2008-2011 by the following authors:                         |
 // |                                                                           |
 // | Authors: Matt West - matt AT mattdanger DOT net                           |
 // |          Dirk Haun - dirk AT haun-online DOT de                           |
@@ -81,6 +81,11 @@
         $fields = explode(',', str_replace(' ', '', $fieldlist));
         $index = array_shift($fields);
 
+        if (empty($_TABLES[$table]) || !DB_checkTableExists($table)) {
+            COM_errorLog("Table $table does not exist - skipping migration");
+            continue;
+        }
+
         $result = DB_query("SELECT $fieldlist FROM {$_TABLES[$table]}");
         $numRows = DB_numRows($result);
         for ($i = 0; $i < $numRows; $i++) {



More information about the geeklog-cvs mailing list