Defect #3615

500 Internal Server Error is raised if add an empty comment to the news

Added by Andrew Rudenko over 8 years ago. Updated about 8 years ago.

Status:ClosedStart date:2009-07-15
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:News
Target version:0.8.5
Resolution:Fixed Affected version:

Description

There is ability to add a comment to the news. And 500 Internal Server Error is rendered if adds an empty comment.
I'm using
  • Redmine 0.8.4.devel.2815
  • PostgreSQL 8.0.15
  • Ruby 1.8.6 (2009-03-31 patchlevel 368) [i486-linux]
  • Rails 2.2.2
ActionView::TemplateError (undefined method `any?' for nil:NilClass) on line #45 of app/views/news/show.rhtml:
42:     </div>
43:     <h4><%= authoring comment.created_on, comment.author %></h4>
44:     <%= textilizable(comment.comments) %>
45: <% end if @comments.any? %>
46: </div>
47:
48: <% if authorize_for 'news', 'add_comment' %>

    app/views/news/show.rhtml:45
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_view/renderable.rb:39:in `send'
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_view
....

empty_news_comments_fix.patch Magnifier - Redmine 0.8.4.devel.2815 (1.94 KB) Chris Grieger, 2009-07-15 22:00

Associated revisions

Revision 2820
Added by Jean-Philippe Lang over 8 years ago

Fixed: error raised when trying to add an empty comment to a news (#3615).

History

#1 Updated by Chris Grieger over 8 years ago

I've attached a patch for it.

#2 Updated by Mischa The Evil over 8 years ago

  • Priority changed from Low to Normal

I can confirm the described behaviour also.

I've corrected the issue-description by wrapping the trace into pre-tags to prevent line-endings to be ignored. I also corrected the issue-priority.

Regards,

Mischa.

#3 Updated by Jean-Philippe Lang over 8 years ago

  • Status changed from New to Resolved
  • Target version set to 0.8.5
  • Resolution set to Fixed

Fixed in r2820.
Thanks for pointing this out.

#4 Updated by Jean-Philippe Lang about 8 years ago

  • Status changed from Resolved to Closed

Merged in 0.8-stable in r2881.

Also available in: Atom PDF