]> source.dussan.org Git - redmine.git/commitdiff
Merged r11332 from trunk (#13097).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 12 Feb 2013 18:03:16 +0000 (18:03 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 12 Feb 2013 18:03:16 +0000 (18:03 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.2-stable@11364 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/project.rb

index fbc189c0cb733adb7825ec61f1427f972e11dade..fe75572caed789973ab1095691315cf29f2c285e 100644 (file)
@@ -731,7 +731,7 @@ class Project < ActiveRecord::Base
   def copy_wiki(project)
     # Check that the source project has a wiki first
     unless project.wiki.nil?
-      self.wiki ||= Wiki.new
+      wiki = self.wiki || Wiki.new
       wiki.attributes = project.wiki.attributes.dup.except("id", "project_id")
       wiki_pages_map = {}
       project.wiki.pages.each do |page|
@@ -743,6 +743,8 @@ class Project < ActiveRecord::Base
         wiki.pages << new_wiki_page
         wiki_pages_map[page.id] = new_wiki_page
       end
+
+      self.wiki = wiki
       wiki.save
       # Reproduce page hierarchy
       project.wiki.pages.each do |page|