When you delete an issue status and reassign existing issues, comments that moved in/out of that status are untouched
| Project: | Project issue tracking |
| Version: | 6.x-1.x-dev |
| Component: | User interface |
| Category: | bug report |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | active |
I noticed this bug while working on a fix for #397262: Can not delete issue status options at admin/project/project-issue-status. However, this is a separate piece, and it's never worked before, and it's a big enough change that I wanted to split it out into a new issue. Basically, if you delete an existing issue status, and there are issues using that status, there's code on the confirm form that forces you to select which new status you want to assign all the existing issues to. That part works fine. However, comments that moved an issue in to or out of the old status end up in a slightly weird state. For example, the table of meta data changes for a comment that was moving an issue from active into the deleted state now looks like this:
Priority: normal » minor
Status: active » Maybe that's what it should do -- the user chose another status when they added the comment, and that comment doesn't exist anymore, so you just see a blank there. But, the issue just silently says it now has the new value, and there's no obvious reason it's in the current status like this.
I know this is an edge-case, hence minor. But, perhaps we should add the following query to the submit handler when you confirm the deletion of a status and reassign existing issues to a new status:
db_query("UPDATE {project_issue_comments} SET sid = %d WHERE sid = %d", $form_state['values']['new_sid'], $form_state['values']['sid']);Thoughts?
