Defect #4126

Error trying to show repository when there are no comments in a changeset

Added by Ben Wagaman almost 8 years ago. Updated over 5 years ago.

Status:ClosedStart date:2009-10-27
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:SCM
Target version:0.8.6
Resolution:Fixed Affected version:

Description

  • Redmine 0.8.4.stable
  • Ruby 1.8.6
  • Oracle 10g
  • Subversion Repository Connection

Processing RepositoriesController#show (for 10.129.44.114 at 2009-10-27 14:16:34) [GET]
Session ID: 606570268ff36b4c60de6db013c4fcc8
Parameters: {"action"=>"show", "id"=>"rsam", "controller"=>"repositories"}

ActionView::TemplateError (private method `gsub' called for nil:NilClass) on line #9 of mailer/issue_edit.text.html.rhtml:
6: <% end %>
7: </ul>
8:
9: <%= textilizable(@journal, :notes, :only_path => false) %>
10: <hr />
11: <%= render :partial => "issue_text_html", :locals => { :issue => @issue, :issue_url => @issue_url } %>

app/helpers/application_helper.rb:162:in `truncate_single_line'
app/helpers/application_helper.rb:396:in `textilizable'
app/helpers/application_helper.rb:388:in `gsub'
app/helpers/application_helper.rb:388:in `textilizable'
app/views/mailer/issue_edit.text.html.rhtml:9:in `_run_erb_47app47views47mailer47issue_edit46text46html46rhtml'
vendor/rails/actionpack/lib/action_view/base.rb:342:in `send'
vendor/rails/actionpack/lib/action_view/base.rb:342:in `execute'
vendor/rails/actionpack/lib/action_view/template_handlers/compilable.rb:29:in `send'
vendor/rails/actionpack/lib/action_view/template_handlers/compilable.rb:29:in `render'
vendor/rails/actionpack/lib/action_view/template.rb:35:in `render'
vendor/rails/actionpack/lib/action_view/template.rb:22:in `render_template'
vendor/rails/actionpack/lib/action_view/base.rb:248:in `render_file'
vendor/rails/actionpack/lib/action_view/base.rb:273:in `render'q:q
vendor/rails/actionmailer/lib/action_mailer/base.rb:542:in `render'
app/models/mailer.rb:241:in `render_message'
vendor/rails/actionmailer/lib/action_mailer/base.rb:464:in `create!'
vendor/rails/actionmailer/lib/action_mailer/base.rb:456:in `each'
vendor/rails/actionmailer/lib/action_mailer/base.rb:456:in `create!'
vendor/rails/actionmailer/lib/action_mailer/base.rb:439:in `initialize'
vendor/rails/actionmailer/lib/action_mailer/base.rb:383:in `new'
vendor/rails/actionmailer/lib/action_mailer/base.rb:383:in `method_missing'
app/models/changeset.rb:116:in `scan_comment_for_issue_ids'
app/models/changeset.rb:103:in `each'
app/models/changeset.rb:103:in `scan_comment_for_issue_ids'
app/models/changeset.rb:96:in `each'
app/models/changeset.rb:96:in `scan_comment_for_issue_ids'
app/models/changeset.rb:70:in `after_create'
vendor/rails/activerecord/lib/active_record/callbacks.rb:301:in `send'
vendor/rails/activerecord/lib/active_record/callbacks.rb:301:in `callback'
vendor/rails/activerecord/lib/active_record/callbacks.rb:221:in `create_without_timestamps'
vendor/rails/activerecord/lib/active_record/timestamp.rb:29:in `create'
vendor/rails/activerecord/lib/active_record/base.rb:2483:in `create_or_update_without_callbacks'
vendor/rails/activerecord/lib/active_record/callbacks.rb:207:in `create_or_update'
vendor/rails/activerecord/lib/active_record/base.rb:2211:in `save_without_validation'
vendor/rails/activerecord/lib/active_record/validations.rb:911:in `save_without_dirty'
vendor/rails/activerecord/lib/active_record/dirty.rb:75:in `save_without_transactions'
vendor/rails/activerecord/lib/active_record/transactions.rb:106:in `save'
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in `transaction'
vendor/rails/activerecord/lib/active_record/transactions.rb:79:in `transaction'
vendor/rails/activerecord/lib/active_record/transactions.rb:98:in `transaction'
vendor/rails/activerecord/lib/active_record/transactions.rb:106:in `save'
vendor/rails/activerecord/lib/active_record/transactions.rb:118:in `rollback_active_record_state!'
vendor/rails/activerecord/lib/active_record/transactions.rb:106:in `save'
vendor/rails/activerecord/lib/active_record/base.rb:644:in `create'
app/models/repository/subversion.rb:59:in `fetch_changesets'
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in `transaction'
vendor/rails/activerecord/lib/active_record/transactions.rb:79:in `transaction'
vendor/rails/activerecord/lib/active_record/transactions.rb:98:in `transaction'
app/models/repository/subversion.rb:58:in `fetch_changesets'
app/models/repository/subversion.rb:57:in `reverse_each'
app/models/repository/subversion.rb:57:in `fetch_changesets'
vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:173:in `send'
vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:173:in `method_missing'
app/controllers/repositories_controller.rb:69:in `show'
vendor/rails/actionpack/lib/action_controller/base.rb:1166:in `send'
vendor/rails/actionpack/lib/action_controller/base.rb:1166:in `perform_action_without_filters'
vendor/rails/actionpack/lib/action_controller/filters.rb:579:in `call_filters'
vendor/rails/actionpack/lib/action_controller/filters.rb:572:in `perform_action_without_benchmark'
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
vendor/rails/actionpack/lib/action_controller/rescue.rb:201:in `perform_action_without_caching'
vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb:13:in `perform_action'
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache'
vendor/rails/activerecord/lib/active_record/query_cache.rb:8:in `cache'
vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb:12:in `perform_action'
vendor/rails/actionpack/lib/action_controller/base.rb:529:in `send'
vendor/rails/actionpack/lib/action_controller/base.rb:529:in `process_without_filters'
vendor/rails/actionpack/lib/action_controller/filters.rb:568:in `process_without_session_management_support'
vendor/rails/actionpack/lib/action_controller/session_management.rb:130:in `process'
vendor/rails/actionpack/lib/action_controller/base.rb:389:in `process'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:149:in `handle_request'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:107:in `dispatch'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:104:in `synchronize'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:104:in `dispatch'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:35:in `dispatch'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:76:in `process'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:74:in `synchronize'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:74:in `process'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process_client'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `initialize'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `initialize'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:282:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:281:in `each'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:281:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/command.rb:212:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
/usr/local/bin/mongrel_rails:19:in `load'
/usr/local/bin/mongrel_rails:19

Rendering /local/app/redmine/releases/20090904011500/public/500.html (500 Internal Server Error)

Associated revisions

Revision 2983
Added by Jean-Philippe Lang almost 8 years ago

Fixed error on repository when there are no comments in a changeset (#4126).

History

#1 Updated by Ben Wagaman almost 8 years ago

The easy place to patch is truncate_single_line.

You can call to_s somewhere before calling gsub. This will guard the string argument (in case it isn't a string.

  1. Truncates and returns the string as a single line
    def truncate_single_line(string, *args)
    truncate(string.to_s, *args).gsub(%r{[\r\n]+}m, ' ')
    end

#2 Updated by Jean-Philippe Lang almost 8 years ago

  • Status changed from New to Closed
  • Target version set to 0.8.6
  • Affected version (unused) set to devel
  • Resolution set to Fixed

Fixed in r2983.

Also available in: Atom PDF