From ed569601c3590fed5283d607b90d3cbb9e73cc93 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Fri, 8 Nov 2013 16:34:26 +0800 Subject: [PATCH] two major fix for site setting and bulletin controller --- app/controllers/admin/pages_controller.rb | 12 ++++++++---- .../announcement/front_end/bulletins_controller.rb | 3 +-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/controllers/admin/pages_controller.rb b/app/controllers/admin/pages_controller.rb index 70f8239e..ef16c878 100644 --- a/app/controllers/admin/pages_controller.rb +++ b/app/controllers/admin/pages_controller.rb @@ -21,11 +21,15 @@ class Admin::PagesController < Admin::ItemsController end def update - if params[:page][:category][0] == "" - params[:page][:category] = [] + if params[:page][:category] + if params[:page][:category][0] == "" + params[:page][:category] = [] + end end - if params[:page][:tag][0] == "" - params[:page][:tag] = [] + if params[:page][:tag] + if params[:page][:tag][0] == "" + params[:page][:tag] = [] + end end @item = Page.find(params[:id]) if @item.module_app && @item.module_app.key == 'page_content' && @item.page_contexts.blank? diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb index b6e15a75..06d359ef 100644 --- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb +++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb @@ -26,7 +26,7 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController end def index - + @bulletins = get_bulletins_for_index end def get_bulletins_for_index @@ -47,7 +47,6 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController @bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:category_id.in => params[:category_id], :tagged_ids.in => params[:tag_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num) # @bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:category_id.in=>params[:category_id],:tagged_ids.in=>params[:tag_id]) @current_category = BulletinCategory.from_id(params[:category_id]) rescue nil - debugger elsif !params[:category_id].blank? @bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.where(:category_id.in => params[:category_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num) @current_category = BulletinCategory.from_id(params[:category_id]) rescue nil