imagine_cms 3.0.18 → 3.0.19

Sign up to get free protection for your applications and to get access to all the features.
@@ -192,9 +192,8 @@ module Cms # :nodoc:
192
192
  end
193
193
  end
194
194
  rescue Exception => e
195
- logger.debug "Error rendering from db: #{e.class}: #{e.message}"
196
- # log_error(e)
197
- return rendering_error(e)
195
+ logger.error "Error rendering from db: #{e.class}: #{e.message}"
196
+ rendering_error(e) and return true
198
197
  end
199
198
 
200
199
  # if we haven't rendered something from the db by now, return false
@@ -913,12 +913,12 @@ class Management::CmsController < Management::ApplicationController # :nodoc:
913
913
 
914
914
  if request.post?
915
915
  unless params[:gallery_id].downcase == "new"
916
- redirect_to :action => 'gallery_management', :id => @pg, :gallery_id => params[:gallery_id] and return
916
+ redirect_to :action => 'gallery_management', :id => @pg, :gallery_id => params[:gallery_id]
917
917
  else
918
- render :partial => 'upload_image' and return
918
+ render :partial => 'upload_image'
919
919
  end
920
920
  else
921
- render :partial => 'select_gallery' and return
921
+ render :partial => 'select_gallery'
922
922
  end
923
923
  end
924
924
 
@@ -1469,8 +1469,11 @@ class Management::CmsController < Management::ApplicationController # :nodoc:
1469
1469
  end
1470
1470
 
1471
1471
  def create_preview_image(src_file, dest, force = 0, overlay = 'gallery_small_overlay.png', thumb_size = 90)
1472
+ raise "Source file required" if src_file.blank?
1473
+
1472
1474
  dest = File.join(dest, File.basename(src_file)) if File.directory?(dest)
1473
1475
  if !File.exists?(dest) || force == 1
1476
+ logger.debug "Reading source file #{src_file}"
1474
1477
  im = Magick::Image::read(src_file)[0]
1475
1478
  im_overlay = Magick::Image::read(File.join(ImagineCms::Engine.root, 'app', 'assets', 'images', 'management', overlay))[0]
1476
1479
 
@@ -1551,7 +1554,7 @@ module MiniMagick
1551
1554
  def crop_resized(ncols, nrows, gravity='Center')
1552
1555
  columns = self[:width].to_i
1553
1556
  rows = self[:height].to_i
1554
-
1557
+
1555
1558
  if ncols != columns || nrows != rows
1556
1559
  scale = [ncols/columns.to_f, nrows/rows.to_f].max
1557
1560
  resize("#{scale*(columns+0.5).to_i}x#{scale*(rows+0.5).to_i}")
@@ -1,7 +1,7 @@
1
1
  <div id="delete_gallery_container">
2
2
  <div id="select_gallery_container">
3
3
 
4
- <%- if session[:broken_galleries] and session[:broken_galleries].size > 0 -%>
4
+ <%- if session[:broken_galleries].is_a?(Array) && session[:broken_galleries].size > 0 -%>
5
5
  <div id="broken_galleries" style="margin-bottom: 10px; padding: 10px; background-color: #ffa7b9; border: 2px solid #f03;">
6
6
  <p><b>The following galleries have problems and require fixing:</b></p>
7
7
  <ul style="padding: 0; margin: 0 0 0 15px; list-style-type: disc;">
@@ -15,7 +15,7 @@
15
15
  </div>
16
16
  <%- end -%>
17
17
 
18
- <%- if @galleries.size > 0 -%>
18
+ <%- if @galleries.is_a?(Array) && @galleries.size > 0 -%>
19
19
  <div id="select_gallery">
20
20
  <h2>Select gallery</h2>
21
21
  <%-
@@ -1,3 +1,3 @@
1
1
  module ImagineCms
2
- VERSION = "3.0.18"
2
+ VERSION = "3.0.19"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imagine_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.18
4
+ version: 3.0.19
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: 2013-04-12 00:00:00.000000000 Z
12
+ date: 2013-04-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails