]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #3064. Checking for views/default/welcome.php and aborting upgrade if found...
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 12 Mar 2011 23:27:18 +0000 (23:27 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 12 Mar 2011 23:27:18 +0000 (23:27 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@8678 36083f99-b078-4883-b0ff-0f9b5a30f544

languages/en.php
upgrade.php
views/default/page/upgrade.php

index c597743e97b165aa5d46ac482bb80849792a9f7e..c65aaefd38d3d4ea68edd94db1f54bca09406042 100644 (file)
@@ -955,6 +955,17 @@ Once you have logged in, we highly recommend that you change your password.
        'upgrading' => 'Upgrading...',
        'upgrade:db' => 'Your database was upgraded.',
        'upgrade:core' => 'Your elgg installation was upgraded.',
+       'upgrade:unable_to_upgrade' => 'Unable to upgrade.',
+       'upgrade:unable_to_upgrade_info' =>
+               'This installation cannot be upgraded because legacy views
+               were detected in the Elgg core views directory. These views have been deprecated and need to be
+               removed for Elgg to function correctly. If you have not made changes to Elgg core, you can
+               simply delete the views directory and replace it with the one from the latest
+               package of Elgg downloaded from <a href="http://elgg.org">elgg.org</a>.<br /><br />
+
+               If you need detailed instructions, please visit the <a href="http://docs.elgg.org/wiki/Upgrading_Elgg">
+               Upgrading Elgg documentation</a>.  If you require assistance, please post to the
+               <a href="http://community.elgg.org/pg/groups/discussion/">Community Support Forums</a>.',
 
        'deprecated:function' => '%s() was deprecated by %s()',
 
index b21b32dd97225c6a9f2ec98d5695b03bfe38737f..c235c3f3ef7caed15c14c51a13d0d44388acd0ff 100644 (file)
@@ -24,7 +24,26 @@ if (get_input('upgrade') == 'upgrade') {
        elgg_invalidate_simplecache();
        elgg_filepath_cache_reset();
 } else {
-       echo elgg_view_page(elgg_echo('upgrade'), '', 'upgrade');
+       // if upgrading from < 1.8.0, check for the core view 'welcome' and bail if it's found.
+       // see http://trac.elgg.org/ticket/3064
+       // we're checking the exact view location because it's likely themes will have this view.
+       // we're only concerned with core.
+       $welcome = dirname(__FILE__) . '/views/default/welcome.php';
+       if (file_exists($welcome)) {
+               $content = elgg_view_module('info', elgg_echo('upgrade:unable_to_upgrade'), 
+                               elgg_echo('upgrade:unable_to_upgrade_info'));
+               
+               $params = array(
+                       'content' => $content,
+                       'title' => elgg_echo('upgrade:abort'),
+               );
+
+               $body = elgg_view_layout('one_column', $params);
+               echo elgg_view_page(elgg_echo('upgrade'), $body);
+               exit;
+       }
+
+       echo elgg_view_page(elgg_echo('upgrading'), '', 'upgrade');
        exit;
 }
 
index 9cbd45944f5a0e68bfe204f1f22dca25bda715df..1a92042be5e637544fab70b37111af104f19eee4 100644 (file)
@@ -7,7 +7,7 @@
 ?>
 <html>
        <head>
-               <title><?php echo elgg_echo('upgrading'); ?></title>
+               <?php echo elgg_view('page/elements/head', $vars); ?>
                <meta http-equiv="refresh" content="1;url=<?php echo elgg_get_site_url(); ?>upgrade.php?upgrade=upgrade"/>
        </head>
        <body>