View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0024130||mantisbt||sub-projects||public||2018-03-17 04:24||2022-01-06 05:05|
|Summary||0024130: Deleting a project does not delete sub-projects|
Deleting a project does not delete sub-projects, resulting in orphaned sub-projects.
|Steps To Reproduce|
|Tags||No tags attached.|
Automatic deletion of sub-projects does not always make sense.
+1 for at least not always making sense. Often a single project is a sub-project of multiple projects. I would rather be conservative with project deletion since it can cause data loss that is irreversible.
It actually does make sense depending on what you are trying to achieve. For example, I had an installation of mantis used both for my clients and our internal projects, so I decided to split the two into two separate instances. So I duplicated the site on another server, and began to purge users, tickets, and projects, that were no longer relevant to that particular instance. Deleting single projects is fine, as it also delete all associated tickets. But deleting parent project containing sub-projects left the sub-projects intact, orphaned, and at parent level. I suddenly had a problem finding and [safely] deleting the sub-projects. It too much longer than anticipated, with a more headaches.
When deleting a project I get asked if I am sure, so the message should contain also a warning that sub-project will also be deleted with all their associated tickets. I don't see a problem with this if the user has to give their permission before executing the operation.
So it makes sense for a subset of the use cases. And not for the rest. The tool must address consistently all scenarios.
Let's say we have:
Project C is one project, which is "linked" to A and B as "child"
I think, a good improvement that fits your actual use case, is to improve the project management page to allow a multiple "smart" delete:
Note that in manage projects page one project is listed multiple time following the parent-child hierarchy, so the selected checkbox contains the information of which project has been selected, as well as which child relation was selected.
I thoroughly understood the point about the sub-project assigned to multiple parent project, and I agree with you it could be a problem if it is deleted from a parent project it should not be. Checkboxes could work, frankly anything to make the work easier is a welcome benefit. I have the same task ahead of me, of purging projects from the second mantis instance, but I have stopped for now, cause it's gonna take some time. Presently I have to delete all sub-projects manually one by one, and then finally the parent project. No fun when you have lots and lots. :)
That would be a great feature.
What about a variable in the config file? e.g. $g_enable_subproject_deletion?