View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0020018 | mantisbt | attachments | public | 2015-08-11 02:57 | 2016-08-15 09:02 |
Reporter | badfiles | Assigned To | dregad | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.2.0 | ||||
Target Version | 1.2.20 | Fixed in Version | 1.2.20 | ||
Summary | 0020018: Copied bug attachments have wrong ownership | ||||
Description | When an attachment is copied to a new bug, its metadata is copied partly. | ||||
Tags | No tags attached. | ||||
We don't have a standalone function to copy attachments, are you referring to issue Cloning ? |
|
I mean function file_copy_attachments() of file_api |
|
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) |
|
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. |
|
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. |
|
Sorry about that, I inadvertantly pushed to mantisbt instead of my own fork. |
|
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. |
|
Backported to 1.2.x |
|
MantisBT: master 8392a9b6 2015-08-13 07:51 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 |
Affected Issues 0020018 |
|
mod - core/file_api.php | Diff File | ||
MantisBT: master-1.2.x aa652758 2015-08-13 07:51 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. |
Affected Issues 0020018 |
|
mod - core/file_api.php | Diff File |