diff options
| author | Tim Almdal <tnalmdal@shaw.ca> | 2009-11-13 09:14:39 -0800 |
|---|---|---|
| committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-11-13 09:14:39 -0800 |
| commit | def88149ccf8b542b376b96dd25c52f2ec6920e1 (patch) | |
| tree | 310ec0dfc5ea65dbfa68d3434ef7598d04b00857 /modules/gallery/helpers/gallery_installer.php | |
| parent | ab37d89bba88de676123069e4f9072e3706c4dc0 (diff) | |
Undo using the md5 hash of the module name and block_id, so duplicate blocks are no allowed again
Diffstat (limited to 'modules/gallery/helpers/gallery_installer.php')
| -rw-r--r-- | modules/gallery/helpers/gallery_installer.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index 26cd14f5..2d4a1e04 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -268,7 +268,7 @@ class gallery_installer { module::set_var("gallery", "show_credits", 1); // @todo this string needs to be picked up by l10n_scanner module::set_var("gallery", "credits", "Powered by <a href=\"%url\">Gallery %version</a>"); - module::set_version("gallery", 17); + module::set_version("gallery", 18); } static function upgrade($version) { @@ -410,6 +410,19 @@ class gallery_installer { } module::set_version("gallery", $version = 17); } + + if ($version == 17) { + // Once published we can't go back so reset the keys to a random to allow duplicates + foreach (array("dashboard_sidebar", "dashboard_center", "site.sidebar") as $location) { + $blocks = block_manager::get_active($location); + $new_blocks = array(); + foreach ($blocks as $block) { + $new_blocks[rand()] = $block; + } + block_manager::set_active($location, $new_blocks); + } + module::set_version("gallery", $version = 18); + } } static function uninstall() { |
