Fix #3983: Uploads: NoMethodError - undefined method `>=' for nil:NilClass
* Rename Upload#download_for_upload to #get_file_for_upload. * Fix #get_file_for_upload to raise error if no file or source url was given. * Fix javascript upload validation to disallow submitting form if file is not present and the source is not an url.
This commit is contained in:
@@ -35,7 +35,7 @@ Upload.initialize_submit = function() {
|
||||
|
||||
Upload.validate_upload = function (e) {
|
||||
var error_messages = [];
|
||||
if (($("#upload_file").val() === "") && ($("#upload_source").val() === "") && $("#upload_md5_confirmation").val() === "") {
|
||||
if (($("#upload_file").val() === "") && !/^https?:\/\//i.test($("#upload_source").val()) && $("#upload_md5_confirmation").val() === "") {
|
||||
error_messages.push("Must choose file or specify source");
|
||||
}
|
||||
if (!$("#upload_rating_s").prop("checked") && !$("#upload_rating_q").prop("checked") && !$("#upload_rating_e").prop("checked") &&
|
||||
|
||||
Reference in New Issue
Block a user