Feature #12521

Tracker can not be deleted - because issues of archived projects cannot be found without unarchiving the projects

Added by Walter Seethaler almost 9 years ago. Updated almost 3 years ago.

Status:ReopenedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Administration
Target version:-
Resolution:

Description

Redmine: 1.3.3.stable.9519 (MySQL)
MySQL: 5.0.51a-24+lenny5
ruby 1.8.7 (2010-06-23 patchlevel 299) [x86_64-linux]
rails (2.3.14, 2.3.11)

As a feature, it is not possible to delete the Trackers, of existing issues.

But even after deletion of all related issues of a tracker (in all open and archived projects), it is (sometimes) not possible to delete trackers. This is because when a project is deleted, its issues stay in the database.

A look in the Database:
- when a project is deleted of table: projects
- it's assigned issues stay in table: issues
- eg. issue 2545 has a foreign key, pointing to project 12, which was deleted
- those tickets stay around forever and can not be delete from the UI

Thus, the Tracker of issue 2545, can never be deleted, because of the "zombie" ticket.

DB-Topics: on delete cascade, referential integrity constraint

In addition, when an adminitrator trys to accesses the ticket (/issues/2545), he gets the weird message: 403 - not enough rights. Weird, because an admin has all rights. A better message would help to find bugs faster, especially if this bugs also applies to: versions, documents and so on.

By the way. Redmine is great, thx for your work.

History

#1 Updated by mr gosh over 3 years ago

This Problem is still present and affects me too.
There should be a bossibility to move all tickets with the affected tracker to another tracker or a NULL?
At least during deletion of the tracker itself.

#2 Updated by Marius BALTEANU almost 3 years ago

  • Status changed from New to Closed
  • Resolution set to Invalid

When you delete a project, all the related data is deleted.

mysql> select * from issues where project_id = 3;
+----+------------+------------+---------------------------------+-------------------------------------------------+----------+-------------+-----------+----------------+-------------+------------------+-----------+--------------+---------------------+---------------------+------------+------------+-----------------+-----------+---------+------+------+------------+-----------+
| id | tracker_id | project_id | subject                         | description                                     | due_date | category_id | status_id | assigned_to_id | priority_id | fixed_version_id | author_id | lock_version | created_on          | updated_on          | start_date | done_ratio | estimated_hours | parent_id | root_id | lft  | rgt  | is_private | closed_on |
+----+------------+------------+---------------------------------+-------------------------------------------------+----------+-------------+-----------+----------------+-------------+------------------+-----------+--------------+---------------------+---------------------+------------+------------+-----------------+-----------+---------+------+------+------------+-----------+
|  5 |          1 |          3 | Subproject issue                | This is an issue on a cookbook subproject       | NULL     |        NULL |         1 |           NULL |           4 |             NULL |         2 |            0 | 2018-12-19 18:54:11 | 2018-12-22 18:54:11 | NULL       |          0 |            NULL |      NULL |       5 |    1 |    2 |          0 | NULL      |
| 13 |          1 |          3 | Subproject issue two            | This is a second issue on a cookbook subproject | NULL     |        NULL |         1 |           NULL |           4 |             NULL |         2 |            0 | 2018-12-19 18:54:11 | 2018-12-22 18:54:11 | NULL       |          0 |            NULL |      NULL |      13 |    1 |    2 |          0 | NULL      |
| 14 |          1 |          3 | Private issue on public project | This is a private issue                         | NULL     |        NULL |         1 |           NULL |           5 |             NULL |         2 |            0 | 2018-12-09 18:54:11 | 2018-12-09 18:54:11 | NULL       |          0 |            NULL |      NULL |      14 |    1 |    2 |          1 | NULL      |
| 15 |          3 |          3 | Private issue on public project | This is a private issue                         | NULL     |        NULL |         2 |           NULL |           5 |             NULL |         1 |            0 | 2019-01-10 03:20:53 | 2019-01-10 03:20:53 | 2019-01-10 |          0 |            NULL |      NULL |      15 |    1 |    2 |          1 | NULL      |
+----+------------+------------+---------------------------------+-------------------------------------------------+----------+-------------+-----------+----------------+-------------+------------------+-----------+--------------+---------------------+---------------------+------------+------------+-----------------+-----------+---------+------+------+------------+-----------+
4 rows in set (0.00 sec)

Deleted the project with id 3 from UI, Administration -> Projects

mysql> select * from issues where project_id = 3;
Empty set (0.00 sec)

mr gosh wrote:

There should be a bossibility to move all tickets with the affected tracker to another tracker or a NULL?
At least during deletion of the tracker itself.

You already have this possibility, you can open the Issue global page, filter issues only by the tracker that you want to delete and using bulk edit, change tracker type to another.

#3 Updated by mr gosh almost 3 years ago

Marius BALTEANU wrote:

You already have this possibility, you can open the Issue global page, filter issues only by the tracker that you want to delete and using bulk edit, change tracker type to another.

You're right - but this is not possible if you have closed or archived projects - but this can be achieved by re-opening these projects - perhaps we reconsider our "projects don't get deleted" philosophy at this point. ;)

#4 Updated by Marius BALTEANU almost 3 years ago

  • Tracker changed from Defect to Feature
  • Subject changed from Tracker can not be deleted - because issues of deleted projects stay in the database to Tracker can not be deleted - because issues of archived projects cannot be found without unarchiving the projects
  • Category changed from Database to Issues filter
  • Status changed from Closed to Reopened
  • Resolution deleted (Invalid)

mr gosh wrote:

You're right - but this is not possible if you have closed or archived projects - but this can be achieved by re-opening these projects - perhaps we reconsider our "projects don't get deleted" philosophy at this point. ;)

It is possible when you have closed projects because you can filter issues by "Project's status" (feature available in Redmine 4.0.0, please see #20081), but indeed, for archived projects, you can't and on instances with a lot of archived projects, it could be quite a challenge.

I'm reopening this ticket as s Feature, maybe we can find a solution to help users delete trackers used by issues from archived projects. As a first idea, what do you think if we add to the error message the archived projects that have issues with that tracker?

#5 Updated by Marius BALTEANU almost 3 years ago

  • Category changed from Issues filter to Administration

Also available in: Atom PDF