]> 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:22:13 +0000 (13:22 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Sat, 1 Oct 2011 11:22:13 +0000 (13:22 +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 35640b220b42e2e9c8d517a491755005783d4c5b..265a061d10ac0771935e65c9ec74620a64e43d31 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 %]