Skip to content
This repository has been archived by the owner on Aug 15, 2018. It is now read-only.

Commit

Permalink
fixed an 'orphaned page' bug if creating a page withotu specifying it…
Browse files Browse the repository at this point in the history
…s parent, just place it under first page
  • Loading branch information
Josh Adams committed Mar 12, 2009
1 parent 76ec335 commit e228cfe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 0 additions & 1 deletion ansuz_installed_plugins/ansuz_blog
Submodule ansuz_blog deleted from abbc72
5 changes: 5 additions & 0 deletions app/controllers/admin/pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ def create
@page.name = @page.name.gsub(' ', '_')
@page.settings = params[:settings]
if @page.save
if @page.parent_id.nil?
# If there is no parent, find first page and attach it there
@page.parent_id = Page.first.id if Page.first
@page.save
end
attach_page_plugins
message = 'Page Added Successfully'
@preview_url = @page.ancestor_path + @page.name
Expand Down

0 comments on commit e228cfe

Please sign in to comment.