View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0025948 | mantisbt | scripting | public | 2019-07-30 03:26 | 2019-08-17 14:37 |
Reporter | econsor_ag | Assigned To | dregad | ||
Priority | low | Severity | trivial | Reproducibility | N/A |
Status | closed | Resolution | no change required | ||
Product Version | 2.19.0 | ||||
Summary | 0025948: file_attach_files function from file_api.php not working | ||||
Description | Hello everyone, I recently updated my mantis version from 2.6.0 and I noticed that my custom bugnote fileupload page is not working. Looking into this I found that the file_process_posted_files_for_bug function was removed and replaced with file_attach_files function. I edited the script with the new function and when I submitted my form it worked without error but when I looked into the bugnote page there was only a note without the file uploaded. Just to test it I inserted the deprecated function into file_api.php and it worked. Why is the file_attach_files function not working or am I missing something to make it work? | ||||
Steps To Reproduce | create a new page with a form and a upload field and call $t_file_infos = file_attach_files ( $_POST['bug_id'], $f_files ); | ||||
Additional Information | I am not sure if I set the right details please forgive me if I totally missed the rules. | ||||
Tags | No tags attached. | ||||
As part of the refactoring which took place in 2.11.0 (see MantisBT master 26c869f6 / 0023774) the helper_array_transpose() call was removed from the file_attach_files() function; this is probably why it's no longer working for you. That being said, the correct way to attach files now would be to rely on the relevant Command (i.e. IssueFileAddCommand or possibly IssueNoteAddCommand); have a look at bugnote_add.php for example usage. |
|
Thank you very much @dregad. I really wanted to fix this cleanly.
Now it works as I intended:) |
|
Please note that even if the note is private, attachments are public |
|
I did not know that, thank you. |
|