diff options
author | Brett Profitt <brett.profitt@gmail.com> | 2011-04-16 11:52:37 -0400 |
---|---|---|
committer | Brett Profitt <brett.profitt@gmail.com> | 2011-04-16 11:52:37 -0400 |
commit | 309dff2bf948ab191ccb1e8d4a777e49ad498820 (patch) | |
tree | 813350181be64e239287c0bb587a3a49320a49b7 /engine/lib/upgrades | |
parent | 119ec1f1425ab77ed29c696d99c0c80df3886791 (diff) | |
parent | 2b2afd98c05139c1a5c25f1752e2bb412e26e335 (diff) | |
download | elgg-309dff2bf948ab191ccb1e8d4a777e49ad498820.tar.gz elgg-309dff2bf948ab191ccb1e8d4a777e49ad498820.tar.bz2 |
Merge branch 'master' of github.com:Elgg/Elgg
Diffstat (limited to 'engine/lib/upgrades')
-rw-r--r-- | engine/lib/upgrades/2011010101.php | 18 | ||||
-rw-r--r-- | engine/lib/upgrades/2011032300-1.8_svn-update_default_widgets-7daf5a459720d06d.php | 60 |
2 files changed, 18 insertions, 60 deletions
diff --git a/engine/lib/upgrades/2011010101.php b/engine/lib/upgrades/2011010101.php index be1adac1a..9dbaff1e4 100644 --- a/engine/lib/upgrades/2011010101.php +++ b/engine/lib/upgrades/2011010101.php @@ -73,3 +73,21 @@ remove_metadata($site->guid, 'pluginorder'); remove_metadata($site->guid, 'enabled_plugins'); elgg_set_ignore_access($old_id); + +/** + * @hack + * + * We stop the upgrade at this point because plugins weren't given the chance to + * load due to the new plugin code introduced with Elgg 1.8. Instead, we manually + * set the version and start the upgrade process again. + * + * The variables from upgrade_code() are available because this script was included + */ +if ($upgrade_version > $version) { + datalist_set('version', $upgrade_version); +} + +$processed_upgrades = array_unique($processed_upgrades); +datalist_set('processed_upgrades', serialize($processed_upgrades)); + +forward('upgrade.php'); diff --git a/engine/lib/upgrades/2011032300-1.8_svn-update_default_widgets-7daf5a459720d06d.php b/engine/lib/upgrades/2011032300-1.8_svn-update_default_widgets-7daf5a459720d06d.php deleted file mode 100644 index 6a5f2fa02..000000000 --- a/engine/lib/upgrades/2011032300-1.8_svn-update_default_widgets-7daf5a459720d06d.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php -/** - * Elgg 1.8-svn upgrade 2011032300 - * update_default_widgets - * - * Pre-1.8, default widgets were stored as metadata on a defaultwidgets object. - * Now they are stored as widget objects owned by the site. - */ - -$object = elgg_get_entities(array( - 'type' => 'object', - 'subtype' => 'moddefaultwidgets', - 'limit' => 1, -)); - -if (!$object) { - // nothing to upgrade - return true; -} - -$object = $object[0]; - -$site = elgg_get_site_entity(); - -$ia = elgg_set_ignore_access(true); -foreach (array('profile', 'dashboard') as $context) { - if (isset($object->$context)) { - elgg_push_context($context); - elgg_push_context('default_widgets'); - elgg_push_context('widgets'); - - // deserialize the widget information - list($left, $middle, $right) = split('%%', $object->$context); - $left_widgets = split('::', $left); - $middle_widgets = split('::', $middle); - $right_widgets = split('::', $right); - - // 1st column is right column in default theme - $widgets = array( - 1 => array_reverse($right_widgets), - 2 => array_reverse($middle_widgets), - 3 => array_reverse($left_widgets), - ); - - foreach ($widgets as $column => $column_widgets) { - foreach ($column_widgets as $handler) { - $guid = elgg_create_widget($site->getGUID(), $handler, $context); - if ($guid) { - $widget = get_entity($guid); - $widget->move($column, 0); - } - } - } - - elgg_pop_context(); - elgg_pop_context(); - elgg_pop_context(); - } -} -elgg_set_ignore_access($ia); |