View Issue Details

IDProjectCategoryView StatusLast Update
0020018mantisbtattachmentspublic2016-08-15 09:02
ReporterbadfilesAssigned Todregad 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.0 
Target Version1.2.20Fixed in Version1.2.20 
Summary0020018: Copied bug attachments have wrong ownership
Description

When an attachment is copied to a new bug, its metadata is copied partly.
There should be a reason not to copy user_id.

TagsNo tags attached.

Activities

dregad

dregad

2015-08-11 03:41

developer   ~0051224

We don't have a standalone function to copy attachments, are you referring to issue Cloning ?

badfiles

badfiles

2015-08-11 15:35

reporter   ~0051227

I mean function file_copy_attachments() of file_api

atrol

atrol

2015-08-11 17:02

developer   ~0051228

We should set user_id to the user who is creating the copy (not the user that added the original attachment)

Furthermore we should set date_added to the current date (we copy this information from original attachment at the moment)

dregad

dregad

2015-08-12 11:37

developer   ~0051236

Last edited: 2015-08-12 11:44

View 2 revisions

PR for review https://github.com/mantisbt/mantisbt/pull/630

For the record, this problem exists also in 1.2.x branch, so the fix should probably be backported.

dregad

dregad

2015-08-13 04:27

developer   ~0051242

Following the proposed implementation following atrol's suggestion in 0020018:0051228, a discussion took place in the pull request. Maybe a more targeted fix just correcting the erroneous behavior as reported by badfiles is the better way to go.

dregad

dregad

2015-08-13 12:06

developer   ~0051252

Sorry about that, I inadvertantly pushed to mantisbt instead of my own fork.

dregad

dregad

2015-08-13 12:14

developer   ~0051253

Last edited: 2015-08-13 12:18

View 2 revisions

PR, take 2 https://github.com/mantisbt/mantisbt/pull/632

Roland, as per the discussion in the previous PR and since you were the one proposing the change in behavior, I let you open another issue to track and discuss it (as per vboctor's suggestion) if you feel it's necessary.

dregad

dregad

2015-08-20 08:44

developer   ~0051294

Backported to 1.2.x

Related Changesets

MantisBT: master 8392a9b6

2015-08-13 11:51:59

dregad

Details Diff
Set bug attachment ownership when copying them

file_copy_attachments() did not set user_id when inserting the new
attachment, resulting in that field being set to 0.

The user_id is now set to the original issue's.

Fixes 0020018
mod - core/file_api.php Diff File

MantisBT: master-1.2.x aa652758

2015-08-13 11:51:59

dregad

Details Diff
Set bug attachment ownership when copying them

file_copy_attachments() did not set user_id when inserting the new
attachment, resulting in that field being set to 0.

The user_id is now set to the original issue's.

Fixes 0020018

Backport from master 8392a9b67f9c897849395d42a131fb979f45148f.
mod - core/file_api.php Diff File

Issue History

Date Modified Username Field Change
2015-08-11 02:57 badfiles New Issue
2015-08-11 03:41 dregad Status new => feedback
2015-08-11 03:41 dregad Note Added: 0051224
2015-08-11 15:35 badfiles Note Added: 0051227
2015-08-11 15:35 badfiles Status feedback => new
2015-08-11 17:02 atrol Note Added: 0051228
2015-08-11 17:02 atrol Status new => confirmed
2015-08-12 04:23 dregad Summary Copied bug attachments have wrong ownship => Copied bug attachments have wrong ownership
2015-08-12 11:37 dregad Note Added: 0051236
2015-08-12 11:38 dregad Assigned To => dregad
2015-08-12 11:38 dregad Status confirmed => assigned
2015-08-12 11:39 dregad Category bugtracker => attachments
2015-08-12 11:44 dregad Note Edited: 0051236 View Revisions
2015-08-13 04:27 dregad Note Added: 0051242
2015-08-13 12:01 dregad Changeset attached => MantisBT fix-20018b 59b66a2f
2015-08-13 12:01 dregad Status assigned => resolved
2015-08-13 12:01 dregad Resolution open => fixed
2015-08-13 12:06 dregad Status resolved => assigned
2015-08-13 12:06 dregad Note Added: 0051252
2015-08-13 12:06 dregad Resolution fixed => open
2015-08-13 12:06 dregad Changeset removed MantisBT fix-20018b 59b66a2f =>
2015-08-13 12:14 dregad Note Added: 0051253
2015-08-13 12:18 dregad Note Edited: 0051253 View Revisions
2015-08-20 05:33 dregad Changeset attached => MantisBT master 8392a9b6
2015-08-20 05:33 dregad Status assigned => resolved
2015-08-20 05:33 dregad Resolution open => fixed
2015-08-20 05:33 dregad Fixed in Version => 1.3.0-beta.3
2015-08-20 06:01 atrol Target Version => 1.3.0-beta.3
2015-08-20 08:39 dregad Changeset attached => MantisBT master-1.2.x aa652758
2015-08-20 08:42 dregad Product Version git trunk => 1.2.0
2015-08-20 08:42 dregad Fixed in Version 1.3.0-beta.3 => 1.2.20
2015-08-20 08:42 dregad Target Version 1.3.0-beta.3 => 1.2.20
2015-08-20 08:44 dregad Note Added: 0051294
2016-08-15 09:02 dregad Status resolved => closed