Fix for page_part and widget back-end
This commit is contained in:
1 parent
2d6b70b97f
commit
269e5b033f
2 files changed
+11
-6
No files matched your search
+5
-5
@@ -39,7 +39,7 @@ class Page < Item
|
||||
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
|
||||
|
||||
if menu_part && current_part.name.eql?(menu_part.name)
|
||||
if menu_part && current_part.name.eql?(menu_part.name)
|
||||
if current_part.new_record?
|
||||
current_part.kind = menu_part.kind
|
||||
current_part.public_r_tag = menu_part.public_r_tag
|
||||
@@ -52,10 +52,10 @@ class Page < Item
|
||||
current_part.update_attributes(:kind => menu_part.kind, :public_r_tag => menu_part.public_r_tag, :public_r_tag_object_id => menu_part.public_r_tag_object_id)
|
||||
end
|
||||
end
|
||||
else
|
||||
if current_part.new_record?
|
||||
current_part.save
|
||||
end
|
||||
elsif current_part.new_record?
|
||||
PagePart.without_callback(:save, :after, :update_parent) do
|
||||
current_part.save
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user