Project

General

Profile

Actions

Defect #7385

closed

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

Added by Ngewi Fet about 13 years ago. Updated about 13 years ago.

Status:
Closed
Priority:
Normal
Category:
Issues
Target version:
Start date:
2011-01-20
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

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 projectClosed2011-03-17

Actions
Actions #1

Updated by Jean-Philippe Lang about 13 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.

Actions #2

Updated by Jean-Philippe Lang about 13 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.

Actions

Also available in: Atom PDF