Fix parser common to skip not found module_app

Do not show default widget if there's no data
This commit is contained in:
chris 2013-10-08 16:42:20 +08:00
parent cce68beff1
commit 315a24556c
2 changed files with 10 additions and 9 deletions

View File

@ -1,8 +1,9 @@
<% if @data.present? %>
<%= render :partial => 'shared/search_header',:locals=>{:items=>@data} %>
<%= render @partial %>
<% if @paginate and !@data.blank? %>
<% if @paginate %>
<%= paginate @data, :param_name => :page_main, :params => {:same_page_id => @page_id} %>
<% elsif @page_part.module_app %>
<%= @page_part.module_app.get_registration.default_widget_setting.link_to_more_tag(request,params) %>
<% end %>
<% end %>

View File

@ -286,8 +286,8 @@ module ParserCommon
when 'default_widget'
"/panel/orbit_app/widget/#{part.widget_style}?inner=true"
else
raise ModuleAppError,"PagePart can't find ModuleApp" if part.module_app.nil?
"/panel/#{part.module_app.key}/widget/#{part.widget_path}?inner=true"
# raise ModuleAppError,"PagePart can't find ModuleApp" if part.module_app.nil?
"/panel/#{part.module_app.key}/widget/#{part.widget_path}?inner=true" rescue ''
end
categories_str=(!part[:category].blank? ? part[:category] : category).collect{|t| "category_id[]=#{t}"}.join('&')