]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 582529: Ambiguous error message "You did not specify a file to attach" when delet...
authorFrédéric Buclin <LpSolit@gmail.com>
Sat, 1 Oct 2011 11:19:55 +0000 (13:19 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Sat, 1 Oct 2011 11:19:55 +0000 (13:19 +0200)
a=LpSolit

Bugzilla/Attachment.pm
template/en/default/global/user-error.html.tmpl

index a39dc3af413959e52b373e1f40f402850d3253f7..3a8e7d5d5ffdb7bae02f181f42fb3ab6a96b8bfe 100644 (file)
@@ -565,7 +565,14 @@ sub _check_filename {
     my ($invocant, $filename) = @_;
 
     $filename = clean_text($filename);
-    $filename || ThrowUserError('file_not_specified');
+    if (!$filename) {
+        if (ref $invocant) {
+            ThrowUserError('filename_not_specified');
+        }
+        else {
+            ThrowUserError('file_not_specified');
+        }
+    }
 
     # Remove path info (if any) from the file name.  The browser should do this
     # for us, but some are buggy.  This may not work on Mac file names and could
index 7dac2ee55cc52168be293ff720bf61b20bb5e0ed..d36f27d91d5c9a744dc85b4bfcfa49848feee425 100644 (file)
     [% title = "No File Specified" %]
     You did not specify a file to attach.
 
+  [% ELSIF error == "filename_not_specified" %]
+    [% title = "No Filename Specified" %]
+    You must specify a filename for this attachment.
+
   [% ELSIF error == "file_too_large" %]
     [% title = "File Too Large" %]
     [%# Convert maxlocalattachment from Mb to Kb %]