Commit 6cc4b53897170ee345cdefa7f7669ba893f2b115
Committed by
Fabio Teixeira
1 parent
ff2b2b83
Exists in
fix_cloned_article_parent
Article cloned passing parent by options
Signed-off-by: Fabio Teixeira <fabio1079@gmail.com> Signed-off-by: Simiao Carvalho <simiaosimis@gmail.com> Signed-off-by: Tallys Martins <tallysmartins@gmail.com>
Showing
3 changed files
with
3 additions
and
2 deletions
Show diff stats
app/controllers/my_profile/cms_controller.rb
... | ... | @@ -157,7 +157,7 @@ class CmsController < MyProfileController |
157 | 157 | |
158 | 158 | @article = if params[:clone] |
159 | 159 | current_article = profile.articles.find(params[:id]) |
160 | - current_article.copy_without_save | |
160 | + current_article.copy_without_save({:parent_id => @parent_id}) | |
161 | 161 | else |
162 | 162 | klass.new(article_data) |
163 | 163 | end | ... | ... |
app/models/article.rb
app/views/content_viewer/_article_toolbar.html.erb
... | ... | @@ -32,7 +32,7 @@ |
32 | 32 | <%= modal_button(:new, label_for_new_article(@page), profile.admin_url.merge(:controller => 'cms', :action => 'new', :parent_id => (@page.folder? ? @page : (@page.parent.nil? ? nil : @page.parent)))) unless remove_content_button(:new, @page) %> |
33 | 33 | |
34 | 34 | <% content = content_tag('span', label_for_clone_article(@page)) %> |
35 | - <% url = profile.admin_url.merge({ :controller => 'cms', :action => 'new', :id => @page.id, :clone => true, :type => @page.class }) %> | |
35 | + <% url = profile.admin_url.merge({ :controller => 'cms', :action => 'new', :id => @page.id, :clone => true, :parent_id => (@page.folder? ? @page : (@page.parent.nil? ? nil : @page.parent)), :type => @page.type}) %> | |
36 | 36 | <%= expirable_button @page, :clone, content, url %> |
37 | 37 | <% end %> |
38 | 38 | ... | ... |