diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ce894f1..457352fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Change Log +## [2.7.2](https://github.com/owen2345/camaleon-cms/tree/2.7.2) (2023-03-24) +- Fix bug rendering category pages + ## [2.7.1](https://github.com/owen2345/camaleon-cms/tree/2.7.1) (2023-03-22) - Fix common relationships diff --git a/Gemfile b/Gemfile index 519ec791..948b0f36 100644 --- a/Gemfile +++ b/Gemfile @@ -3,9 +3,9 @@ source 'https://rubygems.org' gemspec gem 'non-digest-assets' gem 'oj' -gem 'rails', '~> 7.0.0.rc1' +gem 'rails', '~> 7.0.0' gem 'sassc', '!= 2.3.0' # this version segfaults -gem 'selenium-webdriver' +gem 'selenium-webdriver', "!= 4.8.2" # https://github.com/SeleniumHQ/selenium/issues/11815 gem 'webdrivers' gem 'capybara-screenshot' diff --git a/app/controllers/camaleon_cms/frontend_controller.rb b/app/controllers/camaleon_cms/frontend_controller.rb index 81af90c7..bb922e93 100644 --- a/app/controllers/camaleon_cms/frontend_controller.rb +++ b/app/controllers/camaleon_cms/frontend_controller.rb @@ -29,9 +29,7 @@ def index # render category list def category begin - if params[:category_slug].present? - @category ||= current_site.the_full_categories.find_by_slug(params[:category_slug]).decorate - end + @category ||= current_site.the_full_categories.find_by_slug(params[:category_slug]).decorate if params[:category_slug].present? @category ||= current_site.the_full_categories.find(params[:category_id]).decorate @post_type = @category.the_post_type rescue StandardError @@ -49,12 +47,11 @@ def category r_file = lookup_context.template_exists?("categories/#{@category.the_slug}") ? "categories/#{@category.the_slug}" : 'category' end - unless layout_.present? - layout_ = lookup_context.template_exists?("layouts/post_types/#{@post_type.the_slug}/category") ? "post_types/#{@post_type.the_slug}/category" : nil - end - unless layout_.present? - layout_ = lookup_context.template_exists?("layouts/categories/#{@category.the_slug}") ? "categories/#{@category.the_slug}" : nil - end + layout_ = if lookup_context.template_exists?("layouts/post_types/#{@post_type.the_slug}/category") + "post_types/#{@post_type.the_slug}/category" + elsif lookup_context.template_exists?("layouts/categories/#{@category.the_slug}") + "categories/#{@category.the_slug}" + end r = { category: @category, layout: layout_, render: r_file } hooks_run('on_render_category', r) render r[:render], (!r[:layout].nil? ? { layout: r[:layout] } : {}) diff --git a/camaleon_cms.gemspec b/camaleon_cms.gemspec index ce3ed6d4..ce168bf6 100644 --- a/camaleon_cms.gemspec +++ b/camaleon_cms.gemspec @@ -20,8 +20,7 @@ Gem::Specification.new do |s| s.requirements << 'imagemagick' # s.post_install_message = "Thank you for install Camaleon CMS." - s.files = Dir['{app,config,db,lib}/**/*', 'MIT-LICENSE', 'Rakefile', 'README.md', 'public/**/*'] - s.test_files = Dir['spec/**/*'] + s.files = Dir['{app,config,db,lib}/**/*', 'MIT-LICENSE', 'Rakefile', 'README.md'] s.add_dependency 'bcrypt' s.add_dependency 'breadcrumbs_on_rails' diff --git a/gemfiles/rails_6_0.gemfile b/gemfiles/rails_6_0.gemfile index 4896e9f7..15621360 100644 --- a/gemfiles/rails_6_0.gemfile +++ b/gemfiles/rails_6_0.gemfile @@ -11,6 +11,6 @@ gem 'puma' gem 'rack_session_access' gem 'rails', '~> 6.0.0' gem 'rspec_junit_formatter' -gem 'selenium-webdriver' +gem 'selenium-webdriver', '!= 4.8.2' gem 'sqlite3' gem 'webdrivers' diff --git a/gemfiles/rails_6_1.gemfile b/gemfiles/rails_6_1.gemfile index 2c63b2c8..55aca86d 100644 --- a/gemfiles/rails_6_1.gemfile +++ b/gemfiles/rails_6_1.gemfile @@ -11,6 +11,6 @@ gem 'puma' gem 'rack_session_access' gem 'rails', '~> 6.1.0' gem 'rspec_junit_formatter' -gem 'selenium-webdriver' +gem 'selenium-webdriver', '!= 4.8.2' gem 'sqlite3' gem 'webdrivers' diff --git a/gemfiles/rails_7_0.gemfile b/gemfiles/rails_7_0.gemfile index bc320876..9cfaae36 100644 --- a/gemfiles/rails_7_0.gemfile +++ b/gemfiles/rails_7_0.gemfile @@ -11,6 +11,6 @@ gem 'puma' gem 'rack_session_access' gem 'rails', '~> 7.0.1' gem 'rspec_junit_formatter' -gem 'selenium-webdriver' +gem 'selenium-webdriver', '!= 4.8.2' gem 'sqlite3' gem 'webdrivers' diff --git a/gemfiles/rails_edge.gemfile b/gemfiles/rails_edge.gemfile index 921b31b8..e03ed1da 100644 --- a/gemfiles/rails_edge.gemfile +++ b/gemfiles/rails_edge.gemfile @@ -11,6 +11,6 @@ gem 'puma' gem 'rack_session_access' gem 'rails', github: 'rails/rails' gem 'rspec_junit_formatter' -gem 'selenium-webdriver' +gem 'selenium-webdriver', '!= 4.8.2' gem 'sqlite3' gem 'webdrivers' diff --git a/lib/camaleon_cms/version.rb b/lib/camaleon_cms/version.rb index 2411a4d5..37eb25b4 100644 --- a/lib/camaleon_cms/version.rb +++ b/lib/camaleon_cms/version.rb @@ -1,3 +1,3 @@ module CamaleonCms - VERSION = '2.7.1'.freeze + VERSION = '2.7.2'.freeze end