bcms_kcfinder 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,8 +14,10 @@ module BcmsKcfinder
14
14
  # At the start, the entire Sitemap tree has to be defined, though pages below the top level do not need to be included until a 'chDir'
15
15
  # command is issued.
16
16
  def init
17
+ logger.warn "Use the right root section"
18
+ @root_section = Cms::Section.root.first
17
19
  @section = Cms::Section.find_by_name_path("/")
18
- render :json => {tree: {name: "My Site",
20
+ render :json => {tree: {name: @root_section.name,
19
21
  readable: true,
20
22
  writable: true,
21
23
  removable: false,
@@ -89,7 +91,10 @@ module BcmsKcfinder
89
91
  def render_files(files)
90
92
  files.map do |file|
91
93
  {
92
- name: file.name,
94
+ # Handle having a possibly 'null' data_file_name, which might happen if upgrades aren't successful.
95
+ # Otherwise, the UI can't sort items correctly
96
+ name: file.name ? file.name : "",
97
+
93
98
  size: file.size_in_bytes,
94
99
  path: file.link_to_path,
95
100
  mtime: file.updated_at.to_i,
@@ -99,7 +104,8 @@ module BcmsKcfinder
99
104
  bigIcon: true,
100
105
  smallIcon: true,
101
106
  thumb: false,
102
- smallThumb: false
107
+ smallThumb: false,
108
+ cms_id: file.id
103
109
  }
104
110
  end
105
111
  end
@@ -1,3 +1,3 @@
1
1
  module BcmsKcfinder
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bcms_kcfinder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-07 00:00:00.000000000 Z
12
+ date: 2012-08-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: browsercms
@@ -429,7 +429,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
429
429
  version: '0'
430
430
  segments:
431
431
  - 0
432
- hash: 1618175868800973368
432
+ hash: 1237710586151049811
433
433
  required_rubygems_version: !ruby/object:Gem::Requirement
434
434
  none: false
435
435
  requirements:
@@ -438,7 +438,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
438
438
  version: '0'
439
439
  segments:
440
440
  - 0
441
- hash: 1618175868800973368
441
+ hash: 1237710586151049811
442
442
  requirements: []
443
443
  rubyforge_project:
444
444
  rubygems_version: 1.8.24