diff options
-rw-r--r-- | extensions/BugModal/Extension.pm | 21 | ||||
-rwxr-xr-x | userprefs.cgi | 3 |
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); } |