diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2011-10-01 13:22:13 +0200 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2011-10-01 13:22:13 +0200 |
commit | 898e5ab5f292d8d0d72ae0aa9fc6d4638e5d6eca (patch) | |
tree | 12578cfd06ae792777e9ef93dc5b0a95d6d5fbfb | |
parent | f517974618ba835014e9d2a3565109af469f5d34 (diff) | |
download | bugzilla-898e5ab5f292d8d0d72ae0aa9fc6d4638e5d6eca.tar.gz bugzilla-898e5ab5f292d8d0d72ae0aa9fc6d4638e5d6eca.tar.xz |
Bug 582529: Ambiguous error message "You did not specify a file to attach" when deleting an existing attachment filename
a=LpSolit
-rw-r--r-- | Bugzilla/Attachment.pm | 9 | ||||
-rw-r--r-- | template/en/default/global/user-error.html.tmpl | 4 |
2 files changed, 12 insertions, 1 deletions
diff --git a/Bugzilla/Attachment.pm b/Bugzilla/Attachment.pm index a39dc3af4..3a8e7d5d5 100644 --- a/Bugzilla/Attachment.pm +++ b/Bugzilla/Attachment.pm @@ -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 diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index 35640b220..265a061d1 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -599,6 +599,10 @@ [% 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 %] |