diff --git a/app/models/page.rb b/app/models/page.rb index df321d04..5a742e92 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -29,7 +29,7 @@ class Page < Item def create_parts page_design = self.design parent = self.parent - menu_part = parent.page_parts.detect{|page_part| page_part.kind.eql?('public_r_tag') && page_part.public_r_tag.eql?('sub_menu') && page_part.public_r_tag_object_id.eql?(parent.id.to_s)} + menu_part = parent.page_parts.detect{|page_part| page_part.kind.eql?('public_r_tag') && page_part.public_r_tag.eql?('sub_menu') && page_part.public_r_tag_object_id.eql?(parent.id.to_s)} if parent page_design.layout.layout_parts.each do |layout_part| current_part = self.page_parts.detect{|page_part| page_part.name.eql?(layout_part.name)} current_part = self.page_parts.build(:name => layout_part.name) unless current_part diff --git a/lib/parsers/parser_common.rb b/lib/parsers/parser_common.rb index 28600980..be676544 100644 --- a/lib/parsers/parser_common.rb +++ b/lib/parsers/parser_common.rb @@ -111,19 +111,21 @@ module ParserCommon # sub_menus def parse_sub_menus(body = nil, page = nil, id = nil, edit=nil) body.css('sub_menu').each do |sub_menu| - menu_page = Page.find(sub_menu['id']) + menu_page = Page.find(sub_menu['id']) rescue nil res = '' - res << "