From d85c8a1fe1417e6fd2d8733d5877bb21de2d7526 Mon Sep 17 00:00:00 2001 From: Tallys Martins Date: Mon, 25 Jan 2016 17:28:40 -0200 Subject: [PATCH] Fixes bug on forum topic creation --- app/controllers/my_profile/cms_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/my_profile/cms_controller.rb b/app/controllers/my_profile/cms_controller.rb index 34f2a66..11c715a 100644 --- a/app/controllers/my_profile/cms_controller.rb +++ b/app/controllers/my_profile/cms_controller.rb @@ -32,7 +32,8 @@ class CmsController < MyProfileController end protect_if :only => [:new, :upload_files] do |c, user, profile| - parent = profile.articles.find_by_id(c.params[:parent_id]) + parent_id = c.params[:article].present? ? c.params[:article][:parent_id] : c.params[:parent_id] + parent = profile.articles.find_by_id(parent_id) user && user.can_post_content?(profile, parent) end -- libgit2 0.21.2