Commit d85c8a1fe1417e6fd2d8733d5877bb21de2d7526

Authored by Tallys Martins
Committed by Rodrigo Souto
1 parent 8e65e1f3

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 &lt; MyProfileController
32 32 end
33 33  
34 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 37 user && user.can_post_content?(profile, parent)
37 38 end
38 39  
... ...