Defect #31087

Deleting a version silently deletes its attachments

Added by Go MAEDA 3 months ago. Updated 3 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Files
Target version:3.4.10
Resolution:Fixed Affected version:

Description

Deleting a version which has one or more attachments unexpectedly succeeds if no issues are associated with the version.

You can reproduce the problem with the following steps:

1. Create a new version
2. Open the "Files" tab in the project menu
3. Attach a file to the version
4. Delete the version. Attached files are deleted along with the version without warning

I think Redmine should not allow deleting a version with attachments.

The problem was originally reported by Karel Pičman in #1265#note-6. He also provided a patch.

31087.patch Magnifier (1.03 KB) Takenori TAKAKI, 2019-03-26 09:44

Associated revisions

Revision 18008
Added by Go MAEDA 3 months ago

Fix that deleting a version silently deletes its attachments (#31087).

Patch by Karel Pičman and Takenori TAKAKI.

Revision 18009
Added by Go MAEDA 3 months ago

Merged r18008 from trunk to 4.0-stable (#31087).

Revision 18010
Added by Go MAEDA 3 months ago

Merged r18008 from trunk to 3.4-stable (#31087).

History

#1 Updated by Go MAEDA 3 months ago

  • Description updated (diff)

#2 Updated by Takenori TAKAKI 3 months ago

Go MAEDA wrote:

You can reproduce the problem with the following steps:

1. Create a new version
2. Open the "Files" tab in the project menu
3. Attach a file to the version
4. Delete the version. Attached files are deleted along with the version without warning

I think Redmine should not allow deleting a version with attachments.

I could reproduce this problem on my environment. I also think that Redmine should not allow deleting the version with attachments.
I made a patch that added test code to the Karel Pičman's patch.

#3 Updated by Go MAEDA 3 months ago

  • Target version set to 3.4.10

Setting the target version to 3.4.10.

#4 Updated by Go MAEDA 3 months ago

  • Subject changed from Deleting a version deletes files attached to the version without warning to Fix that deleting a version silently deletes its attachments
  • Status changed from New to Resolved
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch. Thank you.

#5 Updated by Go MAEDA 3 months ago

  • Subject changed from Fix that deleting a version silently deletes its attachments to Deleting a version silently deletes its attachments

#6 Updated by Go MAEDA 3 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF