View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0026128||mantisbt||ui||public||2019-09-12 03:58||2019-12-09 04:32|
|Priority||normal||Severity||minor||Reproducibility||have not tried|
|Target Version||2.23.0||Fixed in Version||2.23.0|
|Summary||0026128: Attachments displayed with empty user|
As seen in an example: 0026127
|Tags||No tags attached.|
First I thought that this was a regression introduced by PR https://github.com/mantisbt/mantisbt/pull/1529, but the same behavior can be observed in 2.22.0 as well.
When adding the attachment, the file_attach_files() function calls file_add() with $p_user_id = 0, while the function expects null to set the default user.
Data fix for attachments having user_id = 0 : set user_id to the linked issue's reporter, if the issue's date_submitted is the same as the attachment's file_added date
MantisBT: master 9d840d2b
2019-09-12 12:47:03Details Diff
|Add file with default value 'null' for user id
This ensures that the file attachment is added with a reference to the
Regression introduced by 255dfdf261c42adb76c4f3b6a157186afe999f9b,
caused attachments uploaded together with the issue's submission to be
linked to user '0' instead of the reporter.
|mod - core/file_api.php||Diff File|