]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 565879: Merge ThrowCodeError("action_unrecognized"), ThrowUserError("no_valid_act...
authorFrédéric Buclin <LpSolit@gmail.com>
Thu, 20 May 2010 15:38:16 +0000 (17:38 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Thu, 20 May 2010 15:38:16 +0000 (17:38 +0200)
r=ghendricks a=LpSolit

21 files changed:
attachment.cgi
buglist.cgi
chart.cgi
editclassifications.cgi
editcomponents.cgi
editfields.cgi
editflagtypes.cgi
editgroups.cgi
editkeywords.cgi
editmilestones.cgi
editproducts.cgi
editusers.cgi
editvalues.cgi
editversions.cgi
editworkflow.cgi
relogin.cgi
report.cgi
template/en/default/global/code-error.html.tmpl
template/en/default/global/user-error.html.tmpl
token.cgi
votes.cgi

index b6515d037fa9a674202f74891bcea8dcbcb54bf0..b650a3522742926fcfddc65e84e8831a731e397d 100755 (executable)
@@ -127,7 +127,7 @@ elsif ($action eq "delete") {
 }
 else 
 { 
-  ThrowCodeError("unknown_action", { action => $action });
+  ThrowUserError('unknown_action', {action => $action});
 }
 
 exit;
index 65eb6f380c84e56ede1417e62e6389659954898b..8741f434f86af81aed56ff3e9e10ce96faa43c59 100755 (executable)
@@ -511,7 +511,7 @@ elsif (($cmdtype eq "doit") && defined $cgi->param('remtype')) {
             # We add or remove bugs based on the action choosen.
             my $action = trim($cgi->param('action') || '');
             $action =~ /^(add|remove)$/
-              || ThrowCodeError('unknown_action', {'action' => $action});
+              || ThrowUserError('unknown_action', {action => $action});
 
             # If we are removing bugs, then we must have an existing
             # saved search selected.
index 0b46347b5ea5cc576690ac675b23b4806518b995..dcd83cb01e6aaa25cde9a54b04d7a17b2dfc18c5 100755 (executable)
--- a/chart.cgi
+++ b/chart.cgi
@@ -227,7 +227,7 @@ elsif ($action eq "convert_search") {
     print $cgi->redirect(-location => correct_urlbase() . "query.cgi?format=create-series$url");
 }
 else {
-    ThrowCodeError("unknown_action");
+    ThrowUserError('unknown_action', {action => $action});
 }
 
 exit;
index 61b014c8d7d56e29b5865974d29f5e96a4c772f1..db9dd7f0a877e0a9f71b928a25049deaa1fbd551 100755 (executable)
@@ -233,4 +233,4 @@ if ($action eq 'reclassify') {
 # No valid action found
 #
 
-ThrowCodeError("action_unrecognized", {action => $action});
+ThrowUserError('unknown_action', {action => $action});
index 70afd9c9ff240497477995337fabdaa79bb49bcc..fd30daed45f38f8ae78734cb0aaf118d255762c7 100755 (executable)
@@ -252,7 +252,5 @@ if ($action eq 'update') {
     exit;
 }
 
-#
 # No valid action found
-#
-ThrowUserError('no_valid_action', {'field' => "component"});
+ThrowUserError('unknown_action', {action => $action});
index 0f7a45fb7818534a22ea01ffc14fab39be0831b0..e207a2ee43bc39dbafb8c8d02cf324e1eb1e6a7d 100755 (executable)
@@ -171,5 +171,5 @@ elsif ($action eq 'delete') {
         || ThrowTemplateError($template->error());
 }
 else {
-    ThrowUserError('no_valid_action', {'field' => 'custom_field'});
+    ThrowUserError('unknown_action', {action => $action});
 }
index d389c6db7156ddaf5a2f1e041c9cd526c424255a..a0e64957b00edd6194731bf810e428ec5c37d10d 100755 (executable)
@@ -86,7 +86,7 @@ elsif ($action eq 'confirmdelete')  { confirmDelete();  }
 elsif ($action eq 'delete')         { deleteType($token); }
 elsif ($action eq 'deactivate')     { deactivate($token); }
 else { 
-    ThrowCodeError("action_unrecognized", { action => $action });
+    ThrowUserError('unknown_action', {action => $action});
 }
 
 exit;
index 87a31816d14f24079fef22be7d60454949170fab..a879aa7702e67d49f1a5264ec951d61c3f616ea1 100755 (executable)
@@ -357,13 +357,8 @@ if ($action eq 'remove_regexp') {
     exit;
 }
 
-
-#
 # No valid action found
-#
-
-ThrowCodeError("action_unrecognized", $vars);
-
+ThrowUserError('unknown_action', {action => $action});
 
 # Helper sub to handle the making of changes to a group
 sub doGroupChanges {
index a9b46fef5650a07398e7a9aee5463d09cfd1c71e..6c20dfd05d2a17b3906af392f14251c49df03a3a 100755 (executable)
@@ -183,4 +183,4 @@ if ($action eq 'delete') {
     exit;
 }
 
-ThrowCodeError("action_unrecognized", $vars);
+ThrowUserError('unknown_action', {action => $action});
index ff13b61145c985dde7efce8e0c6d85df4b9224a4..ce622705efcded12f7349c3bd82573bc14e39c0e 100755 (executable)
@@ -218,7 +218,5 @@ if ($action eq 'update') {
     exit;
 }
 
-#
 # No valid action found
-#
-ThrowUserError('no_valid_action', {'field' => "target_milestone"});
+ThrowUserError('unknown_action', {action => $action});
index 4a302aa6cb6311d76bdde4d7fe736c90b3b96275..6d5c5e59356287ee9ca0f9d40147822e61801773 100755 (executable)
@@ -422,8 +422,5 @@ if ($action eq 'updategroupcontrols') {
     exit;
 }
 
-#
 # No valid action found
-#
-
-ThrowUserError('no_valid_action', {field => "product"});
+ThrowUserError('unknown_action', {action => $action});
index 1950446c7f759d204fa854b52ee526245623cac1..f53fde98582edaa04333f1a959954ad8ad75b903 100755 (executable)
@@ -675,8 +675,7 @@ if ($action eq 'search') {
 
 ###########################################################################
 } else {
-    $vars->{'action'} = $action;
-    ThrowCodeError('action_unrecognized', $vars);
+    ThrowUserError('unknown_action', {action => $action});
 }
 
 exit;
index a95385230223ae24adc19ce0777e84c06a1be051..3f08a1671f52a9623f4f1a2fe18371200b5fb824 100755 (executable)
@@ -193,10 +193,5 @@ if ($action eq 'update') {
     display_field_values($vars);
 }
 
-
-#
 # No valid action found
-#
-# We can't get here without $field being defined --
-# See the unless($field) block at the top.
-ThrowUserError('no_valid_action', { field => $field } );
+ThrowUserError('unknown_action', {action => $action});
index b4cf9febc6f8f28a9a212d42a8f85b5dc84e0eaf..0888ef0c64376c2007198df88a6a2990a065ab9d 100755 (executable)
@@ -219,7 +219,5 @@ if ($action eq 'update') {
     exit;
 }
 
-#
 # No valid action found
-#
-ThrowUserError('no_valid_action', {'field' => "version"});
+ThrowUserError('unknown_action', {action => $action});
index 7e51798fc26e8f4c9563de088956e7c6721d07c4..321f077fe5f51b00248ab96baed04b92009fab3f 100755 (executable)
@@ -147,5 +147,5 @@ elsif ($action eq 'update_comment') {
     load_template('comment', 'workflow_updated');
 }
 else {
-    ThrowCodeError("action_unrecognized", {action => $action});
+    ThrowUserError('unknown_action', {action => $action});
 }
index 100fc2c7f165979d1a32c9c795e65a01045c8077..7dcbde6250f7ee7ffa6a938816c64fe5a8763e04 100755 (executable)
@@ -190,7 +190,7 @@ elsif ($action eq 'end-sudo') {
 # No valid action found
 else {
     Bugzilla->login(LOGIN_OPTIONAL);
-    ThrowCodeError('unknown_action', {action => $action});
+    ThrowUserError('unknown_action', {action => $action});
 }
 
 # Display the template
index 4c9a98b8aa4fdc148c0205cf6ab992b52189fbce..0537235fe78e9861a1266397124f94da86b5a92b 100755 (executable)
@@ -289,7 +289,7 @@ elsif ($action eq "plot") {
     $vars->{'data'} = \@image_data;
 }
 else {
-    ThrowCodeError("unknown_action", {action => $cgi->param('action')});
+    ThrowUserError('unknown_action', {action => $action});
 }
 
 my $format = $template->get_format("reports/report", $formatparam,
index e3bd3ba8b0c9916a07086eeee12c8391e368e390..74365a80fa03ad6048e4daf31889d18351bb485e 100644 (file)
 [% DEFAULT title = "Internal Error" %]
 
 [% error_message = BLOCK %]
-  [% IF    error == "action_unrecognized" %]
-    [% docslinks = {'query.html' => "Searching for $terms.bugs",
-                    'query.html#list' => "$terms.Bug lists"} %]
-    I don't recognize the value (<em>[% action FILTER html %]</em>)
-    of the <em>action</em> variable.
-  
-  [% ELSIF error == "attachment_local_storage_disabled" %]
+  [% IF error == "attachment_local_storage_disabled" %]
     [% title = "Local Storage Disabled" %]
     You cannot store attachments locally. This feature is disabled.
 
   [% ELSIF error == "undefined_field" %]
     Form field [% field FILTER html %] was not defined.
     
-  [% ELSIF error == "unknown_action" %]
-    [% IF action %]
-       Unknown action [% action FILTER html %]!
-    [% ELSE %]
-       I could not figure out what you wanted to do.
-    [% END %]
-
   [% ELSIF error == "unknown_method" %]
     The requested method '[% method FILTER html %]' was not found.
 
index c5667bd27dd49d07ab0fb65607b08d3f31e0439f..1d599786103b451aa15716057036230f119703d7 100644 (file)
     Either no products have been defined to enter [% terms.bugs %] against or you have not
     been given access to any.
 
-  [% ELSIF error == "no_valid_action" %]
-    [% title = "No valid action specified" %]
-    Cannot edit [% field_descs.$field FILTER html %]: no valid action was specified.
-
   [% ELSIF error == "number_not_numeric" %]
     [% title = "Numeric Value Required" %]
     The value '[% num FILTER html %]' in the 
     [% END %]
     token too recently to request another. Please wait a while and try again.
 
+  [% ELSIF error == "unknown_action" %]
+    [% IF action %]
+       Unknown action [% action FILTER html %]!
+    [% ELSE %]
+       I could not figure out what you wanted to do.
+    [% END %]
+
   [% ELSIF error == "unknown_keyword" %]
     [% title = "Unknown Keyword" %]
     <code>[% keyword FILTER html %]</code> is not a known keyword.
index d4298cde78882d729bf6ab675ba254f3345c7958..56093038562799ea11a86c747f239fd27e8ca051 100755 (executable)
--- a/token.cgi
+++ b/token.cgi
@@ -56,7 +56,7 @@ Bugzilla->login(LOGIN_OPTIONAL);
 
 # Throw an error if the form does not contain an "action" field specifying
 # what the user wants to do.
-$action || ThrowCodeError("unknown_action");
+$action || ThrowUserError('unknown_action');
 
 # If a token was submitted, make sure it is a valid token that exists in the
 # database and is the correct type for the action being taken.
@@ -163,10 +163,7 @@ if ($action eq 'reqpw') {
 } elsif ($action eq 'cancel_new_account') {
     cancel_create_account($token);
 } else { 
-    # If the action that the user wants to take (specified in the "a" form field)
-    # is none of the above listed actions, display an error telling the user 
-    # that we do not understand what they would like to do.
-    ThrowCodeError("unknown_action", { action => $action });
+    ThrowUserError('unknown_action', {action => $action});
 }
 
 exit;
index b7622fbb04cfd47a094d72ba4e9c8c87e2c08969..04589d4bca413aff3a099a17bf1f67781b6c0e68 100755 (executable)
--- a/votes.cgi
+++ b/votes.cgi
@@ -41,7 +41,7 @@ elsif ($action eq "show_user" or $action eq 'vote') {
     $cgi->param('id', 'voting/user.html');
 }
 else {
-    ThrowCodeError("unknown_action", {action => $action});
+    ThrowUserError('unknown_action', {action => $action});
 }
 
 print $cgi->redirect('page.cgi?' . $cgi->query_string);