From: Tiago Mello Date: Wed, 18 Jan 2012 21:30:54 +0000 (-0200) Subject: Bug 718905: Move user_preferences hook up, before other actions in userprefs.cgi X-Git-Tag: bugzilla-4.3.1~127 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=588cb97721e0a5c3e7009efcba2f6f17da1ce970;p=thirdparty%2Fbugzilla.git Bug 718905: Move user_preferences hook up, before other actions in userprefs.cgi r=dkl, a=LpSolit --- diff --git a/userprefs.cgi b/userprefs.cgi index da6394f801..ac323c65e3 100755 --- a/userprefs.cgi +++ b/userprefs.cgi @@ -499,6 +499,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(); @@ -523,14 +533,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 });