ZoroXing / r-labs

Automatically exported from code.google.com/p/r-labs
0 stars 0 forks source link

ActionView::TemplateError (undefined method `each' for nil:NilClass) on line #39 of vendor/plugins/redmine_code_review/app/views/code_review/_update_diff_view.html.erb #24

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. diff sth. in repository to review
2. internal error occur.
here r the detail:
ActionView::TemplateError (undefined method `each' for nil:NilClass) on
line #39 of
vendor/plugins/redmine_code_review/app/views/code_review/_update_diff_view.html.
erb:
36:   assignments = @attachment.code_review_assignments if @attachment
37:   -%>
38: 
39:   <%= show_assignments assignments, @project, {:action_type =>
@action_type, :rev => @rev, :rev_to => @rev_to, :path => @path, :change_id
=> change_id, :attachment_id => attachment_id} -%>
40:   
41: </div>
42: 

vendor/plugins/redmine_code_review/app/helpers/code_review_helper.rb:20:in
`show_assignments'

vendor/plugins/redmine_code_review/app/views/code_review/_update_diff_view.html.
erb:39

vendor/plugins/redmine_code_review/app/controllers/code_review_controller.rb:219
:in
`update_diff_view'

What is the expected output? What do you see instead?
no review button on the diff.

What version of the product are you using? On what operating system?
SVN Revision r485

how to fix it:
modify the redmine_code_review/app/helpers/code_review_helper.rb line 20

module CodeReviewHelper
  def show_assignments(assignments, project, options = {})
    html = "#{l(:review_assignments)}:"
    if assignments #add this by riceball
      assignments.each do |assignment|
        issue = assignment.issue
        html << link_to("##{issue.id} ", {:controller => 'issues', :action
=> 'show', :id => issue.id},
          :class => issue.css_classes, :title => "#{issue}(#{issue.status})")
      end
    end  #add this by riceball

Original issue reported on code.google.com by SnowYu....@gmail.com on 2 Apr 2010 at 6:38

GoogleCodeExporter commented 8 years ago
Thanks for your report.
I don't understand why this error happens on your environment. Because I think 
the
"assignments" never be nil.
I have never seen that error.

But your code is not bad. So I will merge it.

Original comment by haru.ii.a9i1e on 2 Apr 2010 at 3:26

GoogleCodeExporter commented 8 years ago
I have the same error message in my logs as SnowYu.LEE. I'm using the 
Bitnami.org
installed Redmine v0.9.4 with the Code Review Plugin v0.3.0. I tried the 
modification
that SnowYu.LEE suggests and it fixed it for me too. Please merge this change.

Original comment by khbec...@gmail.com on 14 May 2010 at 3:38

GoogleCodeExporter commented 8 years ago
I just noticed that this was merged according to 
http://www.r-labs.org/issues/320 but
was done differently than SnowYu.LEE's code. I installed the latest build from
http://hudson.r-labs.org/hudson/job/Code%20Review%20Plugin/ but I still have 
the same
issue. Making SnowYu.LEE's change to the code did fix it however.

Original comment by khbec...@gmail.com on 14 May 2010 at 3:47

GoogleCodeExporter commented 8 years ago
ver.0.3.0で
1.リポジトリビューアで任意のファイル(diffではなく)を��
�く
2.右上の「リビジョン」欄に「そのファイルを更新していな
いリビジョン」を入力する
という手順を踏んだところ、表題と同じエラーが発生しま��
�た。
r486の修正を適用することで、このエラーが発生しなくなる�
��とを確認しました。

Original comment by idlysph...@mac.com on 16 Jun 2010 at 1:05

GoogleCodeExporter commented 8 years ago
ありがとうございます。再現できなくて困っていました。
ちなみにリポジトリは何を使用していますか?SVNでしょう��
�?

Original comment by haru.ii.a9i1e on 16 Jun 2010 at 2:22

GoogleCodeExporter commented 8 years ago
はい、SVNです。

Original comment by idlysph...@mac.com on 17 Jun 2010 at 3:37