]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 718905: Move user_preferences hook up, before other actions in userprefs.cgi
authorTiago Mello <timello@gmail.com>
Wed, 18 Jan 2012 21:32:46 +0000 (19:32 -0200)
committerTiago Mello <timello@gmail.com>
Wed, 18 Jan 2012 21:32:46 +0000 (19:32 -0200)
r=dkl, a=LpSolit

userprefs.cgi

index 94fe1def2840e4843f212ce2add7208033746966..f0d5a8e531dd6f99108f0b4a9fe7a97107b9dcec 100755 (executable)
@@ -514,6 +514,16 @@ check_token_data($token, 'edit_user_prefs') if $save_changes;
 
 # Do any saving, and then display the current tab.
 SWITCH: for ($current_tab_name) {
+
+    # Extensions must set it to 1 to confirm the tab is valid.
+    my $handled = 0;
+    Bugzilla::Hook::process('user_preferences',
+                            { 'vars'       => $vars,
+                              save_changes => $save_changes,
+                              current_tab  => $current_tab_name,
+                              handled      => \$handled });
+    last SWITCH if $handled;
+
     /^account$/ && do {
         SaveAccount() if $save_changes;
         DoAccount();
@@ -538,14 +548,6 @@ SWITCH: for ($current_tab_name) {
         DoSavedSearches();
         last SWITCH;
     };
-    # Extensions must set it to 1 to confirm the tab is valid.
-    my $handled = 0;
-    Bugzilla::Hook::process('user_preferences',
-                            { 'vars'       => $vars,
-                              save_changes => $save_changes,
-                              current_tab  => $current_tab_name,
-                              handled      => \$handled });
-    last SWITCH if $handled;
 
     ThrowUserError("unknown_tab",
                    { current_tab_name => $current_tab_name });