diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb
index 3d541fd61..4d4f78d5b 100644
--- a/app/controllers/files_controller.rb
+++ b/app/controllers/files_controller.rb
@@ -226,6 +226,7 @@ class FilesController < ApplicationController
elsif @course
@containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@course.id)]
end
+ show_attachments @containers
@attachtype = params[:type].to_i
@contenttype = params[:contentType].to_s
diff --git a/app/views/files/_course_sort_by_attachtypel.html.erb b/app/views/files/_course_sort_by_attachtypel.html.erb
index f0f6c8270..c13d76620 100644
--- a/app/views/files/_course_sort_by_attachtypel.html.erb
+++ b/app/views/files/_course_sort_by_attachtypel.html.erb
@@ -37,7 +37,7 @@
<%= number_to_human_size(file.filesize) %> |
- <%= file.attachmentstype.typeName %>
+ <%= file.attachmentstype.nil? ? l(:lable_unknow_type):file.attachmentstype.typeName %>
<%= render :partial => 'attachments/course_type_edit', :locals => {:attachmenttypes => attachmenttypes,
diff --git a/app/views/files/_sort_by_attachtypel.html.erb b/app/views/files/_sort_by_attachtypel.html.erb
index d3723c340..eb7ffffec 100644
--- a/app/views/files/_sort_by_attachtypel.html.erb
+++ b/app/views/files/_sort_by_attachtypel.html.erb
@@ -37,7 +37,7 @@
| <%= number_to_human_size(file.filesize) %> |
- <%= file.attachmentstype.typeName %>
+ <%= file.attachmentstype.nil? ? l(:lable_unknow_type):file.attachmentstype.typeName %>
<%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes,
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 602e7a659..46c5360f1 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1807,3 +1807,4 @@ en:
label_company_name: Company Name
notice_account_invalid_creditentials_new: You have not to the mailbox activation
+ lable_unknow_type: Unknow type
\ No newline at end of file
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index eeb2b125e..8f1bd21b0 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -2114,4 +2114,5 @@ zh:
lable_memos_max_length: 帖子内容最大长度为65535个字符
lable_forums_max_length: 贴吧描述最大长度为65535个字符
+ lable_unknow_type: 未知类型
\ No newline at end of file
|