View Issue Details

IDProjectCategoryView StatusLast Update
0026128mantisbtuipublic2019-09-17 11:31
Reportercproensa Assigned Todregad  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
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.

Relationships

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

Activities

2019-09-12 03:58

 

imagen.png (22,733 bytes)   
imagen.png (22,733 bytes)   
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 12:47:03

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

Issue History

Date Modified Username Field Change
2019-09-12 03:58 cproensa New Issue
2019-09-12 03:58 cproensa File Added: imagen.png
2019-09-12 04:37 dregad Relationship added related to 0026082
2019-09-12 05:40 dregad Status new => confirmed
2019-09-12 05:40 dregad Note Added: 0062770
2019-09-12 06:01 dregad Note Added: 0062772
2019-09-12 11:00 dregad Note Added: 0062779
2019-09-13 17:33 dregad Assigned To => dregad
2019-09-13 17:33 dregad Status confirmed => assigned
2019-09-13 17:33 dregad Note Added: 0062793
2019-09-13 17:33 dregad Target Version => 2.23.0
2019-09-17 11:31 dregad Changeset attached => MantisBT master 9d840d2b
2019-09-17 11:31 dregad Status assigned => resolved
2019-09-17 11:31 dregad Resolution open => fixed
2019-09-17 11:31 dregad Fixed in Version => 2.23.0