View Issue Details

IDProjectCategoryView StatusLast Update
0026128mantisbtuipublic2019-12-09 04:32
Reportercproensa Assigned Todregad  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version2.23.0 
Target Version2.23.0Fixed in Version2.23.0 
Summary0026128: Attachments displayed with empty user
Description

As seen in an example: 0026127

TagsNo tags attached.
Attached Files
imagen.png (22,733 bytes)   
imagen.png (22,733 bytes)   

Relationships

related to 0026082 closedvboctor Create a place holder note when submitting attachments without text 

Activities

dregad

dregad

2019-09-12 05:40

developer   ~0062770

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.

dregad

dregad

2019-09-12 06:01

developer   ~0062772

Nevermind what I wrote in 0026128:0062770 - it does NOT occur in 2.22.0, it is indeed a regression, introduced by MantisBT master 255dfdf2

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.

dregad

dregad

2019-09-12 11:00

developer   ~0062779

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

update mantis_bug_file_table f 
join mantis_bug_table b on f.bug_id = b.id 
set user_id = b.reporter_id 
where user_id = 0 and b.date_submitted = f.date_added;
dregad

dregad

2019-09-13 17:33

developer   ~0062793

PR https://github.com/mantisbt/mantisbt/pull/1562

Related Changesets

MantisBT: master 9d840d2b

2019-09-12 08:47

dregad


Details Diff
Add file with default value 'null' for user id

This ensures that the file attachment is added with a reference to the
current user.

Regression introduced by 255dfdf261c42adb76c4f3b6a157186afe999f9b,
caused attachments uploaded together with the issue's submission to be
linked to user '0' instead of the reporter.

Fixes 0026128
Affected Issues
0026128
mod - core/file_api.php Diff File