From 8e6fd277c21b1d98fbabe9a5a74bc424511b64a5 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Fri, 4 May 2012 19:02:40 +0800 Subject: [PATCH] Fix bug: preview was always true --- lib/parsers/parser_front_end.rb | 2 +- .../panel/news/front_end/news_bulletins_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/parsers/parser_front_end.rb b/lib/parsers/parser_front_end.rb index 1cca9915..c95cac4d 100644 --- a/lib/parsers/parser_front_end.rb +++ b/lib/parsers/parser_front_end.rb @@ -46,7 +46,7 @@ module ParserFrontEnd # ret << "&category_id=#{page.category}" if page[:category] ret << "&category_id=#{params[:category_id]}" if !params[:category_id].blank? ret << "&tag_id=#{params[:tag_id]}" if !params[:tag_id].blank? - ret << "&preview=true" if preview + ret << "&preview=true" if preview.eql?('true') ret << "'>" else part = page.page_parts.detect{ |p| p.name.to_s == content['name'].to_s } rescue nil diff --git a/vendor/built_in_modules/news/app/controllers/panel/news/front_end/news_bulletins_controller.rb b/vendor/built_in_modules/news/app/controllers/panel/news/front_end/news_bulletins_controller.rb index 5c870604..bf51d308 100644 --- a/vendor/built_in_modules/news/app/controllers/panel/news/front_end/news_bulletins_controller.rb +++ b/vendor/built_in_modules/news/app/controllers/panel/news/front_end/news_bulletins_controller.rb @@ -27,7 +27,7 @@ class Panel::News::FrontEnd::NewsBulletinsController < OrbitWidgetController if params[:preview] == "true" preview_content else - @news_bulletins = NewsBulletin.can_display.where(_id: params[:id]).first + @news_bulletin = NewsBulletin.can_display.where(_id: params[:id]).first get_categorys end end