Fix show_widget.
This commit is contained in:
parent
c99f1b9176
commit
74eb764277
|
@ -945,10 +945,11 @@ class AnnouncementsController < ApplicationController
|
|||
else
|
||||
@categories = params[:categories]
|
||||
end
|
||||
begin
|
||||
params[:url] = Page.first.find_page(:module=>"announcement",:enabled_for=>I18n.locale.to_s).first.url rescue Page.where(:module=>"announcement",:enabled_for=>I18n.locale.to_s).first.url
|
||||
rescue
|
||||
end
|
||||
root_page = Page.root
|
||||
annc_params = {:module=>"announcement", :enabled_for=>I18n.locale.to_s}
|
||||
annc_page = (root_page.respond_to?(:find_page) ? root_page.find_page(annc_params).first : Page.where(annc_params).first)
|
||||
OrbitHelper.set_page(annc_page) if OrbitHelper.respond_to?(:set_page)
|
||||
params[:url] = (annc_page ? annc_page.url : nil)
|
||||
OrbitHelper.set_site_locale(I18n.locale)
|
||||
OrbitHelper.set_current_widget_module("announcement")
|
||||
OrbitHelper.set_params(params,current_user)
|
||||
|
|
Loading…
Reference in New Issue