From d12e3698e3e6a259f34ced2050e4343f54e130aa Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 13 Nov 2009 09:29:00 -0800 Subject: Call for_js() on all menu labels, since they're SafeStrings. Fixes ticket #879. --- modules/comment/controllers/admin_comments.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/modules/comment/controllers/admin_comments.php b/modules/comment/controllers/admin_comments.php index a164f79f..2c278d64 100644 --- a/modules/comment/controllers/admin_comments.php +++ b/modules/comment/controllers/admin_comments.php @@ -33,10 +33,10 @@ class Admin_Comments_Controller extends Admin_Controller { public function menu_labels() { $menu = $this->_menu($this->_counts()); - print json_encode(array($menu->get("unpublished")->label, - $menu->get("published")->label, - $menu->get("spam")->label, - $menu->get("deleted")->label)); + print json_encode(array($menu->get("unpublished")->label->for_js(), + $menu->get("published")->label->for_js(), + $menu->get("spam")->label->for_js(), + $menu->get("deleted")->label->for_js())); } public function queue($state) { -- cgit v1.2.3 From 100a66d861849ab0d78dca84b0b06c1af973752a Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 14 Nov 2009 12:03:41 -0800 Subject: Fix a bunch of little issues in the version 16, 17, and 18 upgraders. - Add a missing loop in 15->16 causing ticket #881 - Comment the blocks correctly - Remove unnecessary loop from 18->19 --- modules/gallery/helpers/gallery_installer.php | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'modules') diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index 470c54cf..57a5ee9f 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -399,18 +399,21 @@ class gallery_installer { module::set_version("gallery", $version = 16); } + // Convert block keys to an md5 hash of the module and block name if ($version == 16) { - $blocks = block_manager::get_active($location); - $new_blocks = array(); - foreach ($blocks as $block) { - $new_blocks[md5("{$block[0]}:{$block[1]}")] = $block; + 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[md5("{$block[0]}:{$block[1]}")] = $block; + } + block_manager::set_active($location, $new_blocks); } - block_manager::set_active($location, $new_blocks); module::set_version("gallery", $version = 17); } + // We didn't like md5 hashes so convert block keys back to random keys to allow duplicates. 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(); @@ -422,13 +425,11 @@ class gallery_installer { module::set_version("gallery", $version = 18); } + // Rename blocks_site.sidebar to blocks_site_sidebar if ($version == 18) { - // 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("site.sidebar"); - block_manager::set_active("site_sidebar", $blocks); - module::clear_var("gallery", "blocks_site.sidebar"); - } + $blocks = block_manager::get_active("site.sidebar"); + block_manager::set_active("site_sidebar", $blocks); + module::clear_var("gallery", "blocks_site.sidebar"); module::set_version("gallery", $version = 19); } } -- cgit v1.2.3