Defect #7385

Error when viewing an issue which was related to a deleted subtask

Added by Ngewi Fet almost 7 years ago. Updated almost 7 years ago.

Status:ClosedStart date:2011-01-20
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Issues
Target version:1.1.1
Resolution:Fixed Affected version:1.1.0

Description

I get this bug against the current Redmine version 1.1.0.stable.4732
This bug is reproducible with the following steps:

  1. Create an issue A
  2. Create issue B and make it a subtask of A
  3. Create issue C and add B as a related issue
  4. Delete A (Redmine normally also deletes subtasks)
  5. Now try to view issue C and you get Redmine internal error.

Expected:
You should be able to view the issue with no problems

Actual Result:
You get an internal Error 500

Note:
  • Issue C is still accessible through the Edit action.
  • Deleting an issue with a simple issue relation doesn't trigger this.

Error Log:

Processing IssuesController#show (for 10.121.44.164 at 2011-01-19 23:21:51) [GET]
  Parameters: {"action"=>"show", "id"=>"88", "controller"=>"issues"}
Rendering template within layouts/base
Rendering issues/show.rhtml

ActionView::TemplateError (undefined method `visible?' for nil:NilClass) on line #11 of app/views/issues/_relations.rhtml:
8: 
9: <% if @issue.relations.any? %>
10: <table style="width:100%">
11: <% @issue.relations.select {|r| r.other_issue(@issue).visible? }.each do |relation| %>
12: <tr>
13: <td><%= l(relation.label_for(@issue)) %> <%= "(#{l('datetime.distance_in_words.x_days', :count => relation.delay)})" if relation.delay && relation.delay != 0 %>
14:     <%= h(relation.other_issue(@issue).project) + ' - ' if Setting.cross_project_issue_relations? %>

    app/views/issues/_relations.rhtml:11:in `_run_rhtml_app47views47issues47_relations46rhtml_locals_object_relations'
    app/views/issues/_relations.rhtml:11:in `select'
    app/views/issues/_relations.rhtml:11:in `_run_rhtml_app47views47issues47_relations46rhtml_locals_object_relations'
    app/views/issues/show.rhtml:79:in `_run_rhtml_app47views47issues47show46rhtml'
    app/controllers/issues_controller.rb:116:in `show'
    app/controllers/issues_controller.rb:115:in `show'
    /root/passenger-2.2.15/lib/phusion_passenger/rack/request_handler.rb:92:in `process_request'
    /root/passenger-2.2.15/lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
    /root/passenger-2.2.15/lib/phusion_passenger/railz/application_spawner.rb:441:in `start_request_handler'
    /root/passenger-2.2.15/lib/phusion_passenger/railz/application_spawner.rb:381:in `handle_spawn_application'
    /root/passenger-2.2.15/lib/phusion_passenger/utils.rb:252:in `safe_fork'
    /root/passenger-2.2.15/lib/phusion_passenger/railz/application_spawner.rb:377:in `handle_spawn_application'
    /root/passenger-2.2.15/lib/phusion_passenger/abstract_server.rb:352:in `__send__'
    /root/passenger-2.2.15/lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
    /root/passenger-2.2.15/lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
    /root/passenger-2.2.15/lib/phusion_passenger/abstract_server.rb:163:in `start'
    /root/passenger-2.2.15/lib/phusion_passenger/railz/application_spawner.rb:222:in `start'
    /root/passenger-2.2.15/lib/phusion_passenger/spawn_manager.rb:253:in `spawn_rails_application'
    /root/passenger-2.2.15/lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
    /root/passenger-2.2.15/lib/phusion_passenger/spawn_manager.rb:247:in `spawn_rails_application'
    /root/passenger-2.2.15/lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
    /root/passenger-2.2.15/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
    /root/passenger-2.2.15/lib/phusion_passenger/spawn_manager.rb:246:in `spawn_rails_application'
    /root/passenger-2.2.15/lib/phusion_passenger/spawn_manager.rb:145:in `spawn_application'
    /root/passenger-2.2.15/lib/phusion_passenger/spawn_manager.rb:278:in `handle_spawn_application'
    /root/passenger-2.2.15/lib/phusion_passenger/abstract_server.rb:352:in `__send__'
    /root/passenger-2.2.15/lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
    /root/passenger-2.2.15/lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'


Related issues

Related to Redmine - Defect #7904: Subprojects not properly deleted when deleting a parent p... Closed 2011-03-17

Associated revisions

Revision 4735
Added by Jean-Philippe Lang almost 7 years ago

Fixed: subtasks are deleted (not destroyed) when destroying parent issue (#7385).

Revision 4741
Added by Jean-Philippe Lang almost 7 years ago

Moves relations fetching from views to the controller and skip invalid relations (#7385).

History

#1 Updated by Jean-Philippe Lang almost 7 years ago

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

The 500 error is fixed in r4741 which will be merged into 1.1-stable for 1.1.1.
The root problem that caused the relation not to be deleted is fixed in r4735.

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

  • Subject changed from Redmine crashes when viewing an issue which was related to a deleted issue (which had a parent task) to Error when viewing an issue which was related to a deleted subtask
  • Status changed from Resolved to Closed

r4741 merged in 1.1-stable.

Also available in: Atom PDF