Defect #602 ยป file_upload_fix.diff
| app/controllers/projects_controller.rb (working copy) | ||
|---|---|---|
| 262 | 262 |
def add_file |
| 263 | 263 |
if request.post? |
| 264 | 264 |
@version = @project.versions.find_by_id(params[:version_id]) |
| 265 |
if @version == nil |
|
| 266 |
flash[:error] = l(:error_need_version_to_upload_file) |
|
| 267 |
else |
|
| 265 | 268 |
attachments = attach_files(@version, params[:attachments]) |
| 266 | 269 |
Mailer.deliver_attachments_added(attachments) if !attachments.empty? && Setting.notified_events.include?('file_added')
|
| 267 | 270 |
redirect_to :controller => 'projects', :action => 'list_files', :id => @project |
| 271 |
end |
|
| 268 | 272 |
end |
| 269 | 273 |
@versions = @project.versions.sort |
| 270 | 274 |
end |
| lang/en.yml (working copy) | ||
|---|---|---|
| 80 | 80 |
error_can_t_load_default_data: "Default configuration could not be loaded: %s" |
| 81 | 81 |
error_scm_not_found: "Entry and/or revision doesn't exist in the repository." |
| 82 | 82 |
error_scm_command_failed: "An error occurred when trying to access the repository: %s" |
| 83 |
error_need_version_to_upload_file: "Version is required. Create a Version if one doesn't exist." |
|