Oops, fix up a bug originally added in

7d66ab2e94 when I tweaked the name of
the rss_available variable to be rss_visible, but got it wrong.  Bump
the comment module to 6 so that we run the installer and clean up old
vars.

Fixes #1854.
This commit is contained in:
Bharat Mediratta
2012-05-07 13:45:13 -07:00
parent 6effd5f75e
commit 5400c4be26
4 changed files with 17 additions and 7 deletions
+12 -2
View File
@@ -48,8 +48,8 @@ class comment_installer {
module::set_var("comment", "spam_caught", 0);
module::set_var("comment", "access_permissions", "everybody");
module::set_var("comment", "rss_available", "both");
module::set_version("comment", 5);
module::set_var("comment", "rss_visible", "both");
module::set_version("comment", 6);
}
static function upgrade($version) {
@@ -81,6 +81,16 @@ class comment_installer {
module::set_var("comment", "rss_visible", "all");
module::set_version("comment", $version = 5);
}
// In version 5 we accidentally set the installer variable to rss_available when it should
// have been rss_visible. Migrate it over now, if necessary.
if ($version == 5) {
if (!module::get_var("comment", "rss_visible")) {
module::set_var("comment", "rss_visible", module::get_var("comment", "rss_available"));
}
module::clear_var("comment", "rss_available");
module::set_version("comment", $version = 6);
}
}
static function uninstall() {