[6.0 stable] Discussion Template Render Error
Created by: yangchenyun
On the username/repo/merge_requests/178
page, the Ajax request /username/repo/notes.js?target_type=merge_request&target_id=178&_=1378112531364
results in template rendering error:
Started GET "/yangchenyun/huali/notes.js?target_type=merge_request&target_id=178&_=1378112531364" for 127.0.0.1 at 2013-09-02 17:02:11 +0800
Processing by Projects::NotesController#index as JS
Parameters: {"target_type"=>"merge_request", "target_id"=>"178", "_"=>"1378112531364", "project_id"=>"yangchenyun/huali"}
Rendered projects/notes/_note.html.haml (95.6ms)
Rendered projects/notes/_note.html.haml (21.5ms)
Rendered projects/notes/_discussion_reply_button.html.haml (1.7ms)
Rendered projects/notes/_diff_notes_with_reply.html.haml (39.9ms)
Rendered projects/notes/_discussion_diff.html.haml (52.1ms)
Rendered projects/notes/_discussion.html.haml (84.1ms)
Rendered projects/notes/_note.html.haml (13.9ms)
Rendered projects/notes/_note.html.haml (211.0ms)
Rendered projects/notes/_discussion_diff.html.haml (1.0ms)
Rendered projects/notes/_discussion.html.haml (7.2ms)
Rendered projects/notes/_notes.html.haml (430.2ms)
Rendered projects/notes/index.js.haml (445.3ms)
Completed 500 Internal Server Error in 1836ms
ActionView::Template::Error (undefined method `new_path' for nil:NilClass):
3: - if diff && diff.deleted_file
4: %span= diff.old_path
5: - else
6: %span= diff.new_path
7: - if diff.a_mode && diff.b_mode && diff.a_mode != diff.b_mode
8: %span.file-mode= "#{diff.a_mode} → #{diff.b_mode}"
9: %br/
app/views/projects/notes/_discussion_diff.html.haml:6:in `_app_views_projects_notes__discussion_diff_html_haml__140178814007655932_69823327642140'
app/views/projects/notes/_discussion.html.haml:41:in `_app_views_projects_notes__discussion_html_haml___2220279622113151274_69823327354560'
app/views/projects/notes/_notes.html.haml:7:in `block in _app_views_projects_notes__notes_html_haml___81681065283156694_69823323373180'
app/views/projects/notes/_notes.html.haml:2:in `each'
app/views/projects/notes/_notes.html.haml:2:in `_app_views_projects_notes__notes_html_haml___81681065283156694_69823323373180'
app/views/projects/notes/index.js.haml:2:in `_app_views_projects_notes_index_js_haml__1231013612742035773_69823319606640'
app/controllers/projects/notes_controller.rb:17:in `index'