Actions
Defect #14343
closedDelete a file in an copied issu causes redmine crash
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Issues
Target version:
-
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Invalid
Affected version:
Description
Hy,
Something probably weird here.
I copied an issue with 2 files attached.
In the copy issue, I added a file inside, I validated the issue, navigate etc...
Later, I realised that one of the 2 files coming from the copied one was useless. I clicked on the bin icaon and then redmine crashed.
Here is the message :
Processing by IssuesController#show as HTML
Parameters: {"id"=>"961"}
Current user: xxxxxx (id=1)
Rendered issues/_action_menu.html.erb (3.3ms)
Rendered plugins/redmine_code_review/app/views/code_review/_issues_show_details_bottom.html.erb (0.1ms)
Rendered plugins/redmine_lightbox/app/views/attachments/_links.html.erb (5.3ms)
Rendered plugins/redmine_issue_checklist/app/views/issues/_checklist.html.erb (1.8ms)
Rendered issue_relations/_form.html.erb (1.3ms)
Rendered issues/_relations.html.erb (120.5ms)
Rendered plugins/redmine_inline_note_images_plugin/app/views/hooks/inline_image_hook/_inline_images_paste.erb (5.4ms)
Rendered issues/_history.html.erb (7.9ms)
Rendered issues/show.html.erb within layouts/base (158.5ms)
Completed 500 Internal Server Error in 217ms
ActionView::Template::Error (undefined method `image?' for nil:NilClass):
3: <% attachments.push Attachment.find_by_id a.prop_key %>
4: <% end %>
5:
6: <% images = attachments.select(&:image?) %>
7: <% if images.any? %>
8: <div class="journal attachments">
9: <% images.each do |image| %>
lib/redmine/hook.rb:111:in `send'
lib/redmine/hook.rb:111:in `view_issues_history_journal_bottom'
lib/redmine/hook.rb:61:in `send'
lib/redmine/hook.rb:61:in `call_hook'
lib/redmine/hook.rb:61:in `each'
lib/redmine/hook.rb:61:in `call_hook'
lib/redmine/hook.rb:58:in `tap'
lib/redmine/hook.rb:58:in `call_hook'
lib/redmine/hook.rb:158:in `call_hook'
app/views/issues/_history.html.erb:19:in `_app_views_issues__history_html_erb___1595220940_77022580'
app/views/issues/_history.html.erb:2:in `each'
app/views/issues/_history.html.erb:2:in `_app_views_issues__history_html_erb___1595220940_77022580'
app/views/issues/show.html.erb:120:in `_app_views_issues_show_html_erb___1327379965_76646980'
app/controllers/issues_controller.rb:119:in `show'
app/controllers/issues_controller.rb:116:in `show'
I don't know how to change this and keep the issue without deleteing everything in the database
Actions