View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0021994 | mantisbt | attachments | public | 2016-11-30 10:20 | 2017-06-04 14:58 |
Reporter | tk | Assigned To | dregad | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.3.1 | ||||
Target Version | 2.5.0 | Fixed in Version | 2.5.0 | ||
Summary | 0021994: issue with attachments cannot be moved between projects with different upload directories (uploads saved in file system) | ||||
Description | I use file system based attachment uploads. When attempting to move an issue with attachments between projects with different upload directories I see:
After pressing the back button, a) the bug still resides in the source project b) the first attachment of the issue is displayed strike through and marked "(Attachment missing)" c) the stored attachment file on the file system has actually been moved to the upload Folder of the destination project [EDIT: breaking long line to avoid scrolling] | ||||
Additional Information | I see the same effect in version 1.3.1. | ||||
Tags | No tags attached. | ||||
Updating product version since you mentioned it's also not working in 1.3.1 |
|
Tracing through the code, I find this. I added 2 log_events: 2017-02-09 15:04 PST FILE file_api.php:1075 file_move_bug_attachments() Moving attachment /var/mantis/attachments/4/39998f17602597954629f59cc6bcf97b to /var/mantis/attachments/84/39998f17602597954629f59cc6bcf97b 2017-02-09 15:04 PST DB file_api.php:1087 file_move_bug_attachments() array ( log_event(LOG_FILE,'Moving attachment ' . $t_disk_file_name_from . ' to ' . $t_disk_file_name_to); The relevant code bits near mantis/htdocs/core/file_api.php:1060
and |
|
I think just leave off the 'false' at the end of the db_query should fix it. db_query( $t_query_disk_attachment_update, array( db_prepare_string( $t_path_to ), $c_bug_id, (int)$t_row['id'] )); |
|
I've applied the patch proposed in 0021994:0055627 to my mantis 1.3.4 installation ( line no. 1085 in core/file_api.php of that release). Notably the comment in the line preceeding the offending line points to a wrong conclusion drawn during programming that section: |
|
Hi all, is there any chance to get the bug fixed (resp. to get the proposed patch accepted) in 1.3.x ? |
|
I am having this exact same issue in v2.3.1 I am going to try dropping the 'false' at the end of db_query tonight after hours per peter's earlier post as a temporary solution. |
|
Please note that the proposed workaround of dropping the The fix proposed in PR https://github.com/mantisbt/mantisbt/pull/1110 follows the correct approach of providing the default values for $p_limit and $p_offset. |
|
Positively tested the patch in 0021994:0056862 in a mantis 1.3.1 and 1.3.4 environment. In the meantime I had also seen problems with the removed "false", but I was so sure I had written that as a note to that bug that I didn't check it, sorry. |
|
Thanks for the update. I've tested on 2.3.1 and it seems to be working fine now. |
|
MantisBT: master 33e1230b 2017-05-20 04:16 MS-Astra Committer: dregad Details Diff |
Fix moving issues with attachments Issues with attachments cannot be moved between projects with different upload directories when files are stored in file system. Add missing parameters to db_query() call in file_move_bug_attachments(). Fixes 0021994 |
Affected Issues 0021994 |
|
mod - core/file_api.php | Diff File |