summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-09-03 06:18:13 +0200
committerByron Jones <glob@mozilla.com>2015-09-03 06:18:13 +0200
commit3eec411a147f1e69507f06bf3468f897fef2c7e0 (patch)
treebd81b1c553975159803b33658019d1dee6bcfbe5
parenta6c5ec6f935a9bd17e99f5b3190b1af9eb350018 (diff)
downloadbugzilla-3eec411a147f1e69507f06bf3468f897fef2c7e0.tar.gz
bugzilla-3eec411a147f1e69507f06bf3468f897fef2c7e0.tar.xz
Bug 1200961 - switching to the modal view doesn't force the mozilla skin
-rw-r--r--extensions/BugModal/Extension.pm21
-rwxr-xr-xuserprefs.cgi3
2 files changed, 22 insertions, 2 deletions
diff --git a/extensions/BugModal/Extension.pm b/extensions/BugModal/Extension.pm
index da582bae8..54ef8f4ca 100644
--- a/extensions/BugModal/Extension.pm
+++ b/extensions/BugModal/Extension.pm
@@ -24,10 +24,10 @@ use Template::Stash;
our $VERSION = '1';
# force skin to mozilla
-sub setting_set_value {
+sub settings_after_update {
my ($self, $args) = @_;
- return unless $args->{setting} eq 'ui_experiments' && $args->{value} ne 'on';
my $settings = Bugzilla->user->settings;
+ return unless $settings->{ui_experiments}->{value} eq 'on';
return if $settings->{skin}->{value} =~ /^Mozilla/;
$settings->{skin}->set('Mozilla');
}
@@ -293,6 +293,23 @@ sub webservice {
sub install_before_final_checks {
my ($self, $args) = @_;
add_setting('ui_experiments', ['on', 'off'], 'off');
+
+ # ensure the correct skin is being used
+ my $dbh = Bugzilla->dbh;
+ my $users = $dbh->selectcol_arrayref("
+ SELECT
+ ui.user_id
+ FROM
+ profile_setting ui
+ LEFT JOIN profile_setting skin ON skin.user_id = ui.user_id AND skin.setting_name = 'skin'
+ WHERE
+ ui.setting_name = 'ui_experiments'
+ AND ui.setting_value = 'on'
+ AND skin.setting_value NOT LIKE 'Mozilla%'
+ ");
+ foreach my $user_id (@$users) {
+ Bugzilla::User->new($user_id)->settings->{skin}->set('Mozilla');
+ }
}
__PACKAGE__->NAME;
diff --git a/userprefs.cgi b/userprefs.cgi
index 9ec152538..9b86f010c 100755
--- a/userprefs.cgi
+++ b/userprefs.cgi
@@ -209,6 +209,9 @@ sub SaveSettings {
$settings->{$name}->set($value);
}
}
+
+ Bugzilla::Hook::process('settings_after_update');
+
$vars->{'settings'} = $user->settings(1);
clear_settings_cache($user->id);
}