app/controllers/caboose/pages_controller.rb in caboose-cms-0.9.219 vs app/controllers/caboose/pages_controller.rb in caboose-cms-0.9.220
- old
+ new
@@ -740,10 +740,11 @@
new_home.slug = nil
new_home.alias = nil
new_home.uri = nil
new_home.redirect_url = nil
new_home.hide = false
+ new_home.custom_sort_children = old_home.custom_sort_children
new_home.save
new_layout = Caboose::Block.where(:parent_id => nil, :page_id => new_home.id).first
new_footer = new_layout.child('footer') if new_layout
if new_footer && new_footer.children.count > 0
new_footer.children.each do |nc|
@@ -761,9 +762,10 @@
old_home.parent_id = new_home.id
old_home.slug = "old-home-#{old_home.id}"
old_home.uri = "old-home-#{old_home.id}"
old_home.hide = true
old_home.save
+ Caboose::Page.where(:parent_id => old_home.id).update_all(parent_id: new_home.id)
resp.success = true
resp.redirect = "/admin/pages/#{new_home.id}"
else
resp.success = false
resp.error = "You don't have permission to do this."