Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ test/dummy/db/*.sqlite3
test/dummy/log/*.log
test/dummy/tmp/
test/dummy/.sass-cache
# rubymine project ignore#
.idea
4 changes: 1 addition & 3 deletions app/controllers/bcms_kcfinder/browse_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,13 @@ def list_files
end

def render_files(files)
paths = Cms::Attachment.find_by_sql("select attachable_id, data_file_path from cms_attachments a where a.attachable_type = 'Cms::AbstractFileBlock'").inject(Hash.new()){|h,v| h[v.attachable_id] = v.data_file_path; h}
files.map do |file|
{
# Handle having a possibly 'null' data_file_name, which might happen if upgrades aren't successful.
# Otherwise, the UI can't sort items correctly
name: file.name ? file.name : "",

size: file.size_in_bytes,
path: file.is_a?(Cms::Attachment) || file.is_a?(Cms::AbstractFileBlock) ? paths[file.id] : file.path,
path: file.link_to_path,
mtime: file.updated_at.to_i,
date: file.created_at.strftime("%m/%d/%Y %I:%M %p"),
readable: true,
Expand Down