Commit d85c8a1fe1417e6fd2d8733d5877bb21de2d7526
Committed by
Rodrigo Souto
1 parent
8e65e1f3
Exists in
web_steps_improvements
and in
10 other branches
Fixes bug on forum topic creation
Closes #167 - When a topic is created in a forum, the parent_id was not being set. Signed-off-by: Tallys Martins <tallysmartins@yahoo.com.br>
Showing
1 changed file
with
2 additions
and
1 deletions
Show diff stats
app/controllers/my_profile/cms_controller.rb
@@ -32,7 +32,8 @@ class CmsController < MyProfileController | @@ -32,7 +32,8 @@ class CmsController < MyProfileController | ||
32 | end | 32 | end |
33 | 33 | ||
34 | protect_if :only => [:new, :upload_files] do |c, user, profile| | 34 | protect_if :only => [:new, :upload_files] do |c, user, profile| |
35 | - parent = profile.articles.find_by_id(c.params[:parent_id]) | 35 | + parent_id = c.params[:article].present? ? c.params[:article][:parent_id] : c.params[:parent_id] |
36 | + parent = profile.articles.find_by_id(parent_id) | ||
36 | user && user.can_post_content?(profile, parent) | 37 | user && user.can_post_content?(profile, parent) |
37 | end | 38 | end |
38 | 39 |
-
mentioned in commit 853f68390f85f89267c33064e38b982c20ccc489