diff --git a/app/controllers/my_profile/cms_controller.rb b/app/controllers/my_profile/cms_controller.rb index 65e80e0..3125033 100644 --- a/app/controllers/my_profile/cms_controller.rb +++ b/app/controllers/my_profile/cms_controller.rb @@ -29,9 +29,9 @@ class CmsController < MyProfileController end protect_if :only => :new do |c, user, profile| - article_id = c.params[:parent_id] - (!article_id.blank? && (profile.articles.find(article_id).allow_create?(user) || profile.articles.find(article_id).parent.allow_create?(user))) || - (user && (user.has_permission?('post_content', profile) || user.has_permission?('publish_content', profile))) + article = profile.articles.find_by_id(c.params[:parent_id]) + (!article.nil? && (article.allow_create?(user) || article.parent.allow_create?(user))) || + (user && (user.has_permission?('post_content', profile) || user.has_permission?('publish_content', profile))) end protect_if :only => [:destroy, :publish] do |c, user, profile| diff --git a/app/helpers/article_helper.rb b/app/helpers/article_helper.rb index cadd116..47cd45a 100644 --- a/app/helpers/article_helper.rb +++ b/app/helpers/article_helper.rb @@ -55,7 +55,7 @@ module ArticleHelper content_tag( 'div', check_box(:article, :allows_members_to_create_topics) + - content_tag('label', _('Allow member to create topics'), :for => 'article_allows_members_to_create_topics') + content_tag('label', _('Allow members to create topics'), :for => 'article_allows_members_to_create_topics') ) : '') ) end -- libgit2 0.21.2