View Issue Details

IDProjectCategoryView StatusLast Update
0022817mantisbtattachmentspublic2019-12-09 04:32
Reportern - i - i Assigned Tovboctor  
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
Product Version2.3.0 
Target Version2.23.0Fixed in Version2.23.0 
Summary0022817: "private bugnotes" as default setting prevents uploading further attachments
Description

Changing the config option

$g_default_bugnote_view_status = VS_PUBLIC;

to VS_PRIVATE blocks the possibility to add further attachments to an existing issue for users, who can't see private notes, because the checkbox(!) for setting bugnotes to private/public is also used to toggle the display-settings of the dropzone for attachments (which is hidden when the checkbox is checked, because there is no such thing as private attachments).

Since bugnotes for users, who can't see private notes, are (set later on to) public anyway, the checkbox isn't displayed. That means there's no way for those users to toggle the checkbox and therefore make the dropzone visible.

Tested in Mantis version 2.0.0 and 2.3.0.

Additional Information

The problem lies in bugnote_add_inc.php somewhere around line 151 (2.3.0):

$t_attach_style = ( $t_default_bugnote_view_status != VS_PUBLIC ) ? 'display: none;' : '';

This is the initial (and without the checkbox only) part where the display settings for the attachment dropzone is set.

Tagsmantishub

Relationships

has duplicate 0024123 closedatrol Reporter can't upload attachment when bugnote are private by default. 
has duplicate 0025915 closedatrol setting $g_default_bugnote_view_status to private prevent normal users to post attachments 
related to 0009802 closedvboctor Support attachments associated with private notes 
related to 0024573 new cannot reopen or close issue when adding a comment 
related to 0025935 closedvboctor Warning for users when making public notes with attachments private 

Activities

vboctor

vboctor

2017-04-26 11:22

manager   ~0056722

If you remove this line you will be able to attach files, but even though the note will be private, the attachment will be public and available to users who can't see the private note. I have added a relation to 0009802 for private attachments support.

Kurlvink

Kurlvink

2017-11-14 07:21

reporter   ~0058197

Even when you comment that line out it won't work in every case. I noticed that you have to type in a note and then add the attachment, during it the other way the attachment is lost (after it got uploaded).

Kurlvink

Kurlvink

2017-11-20 06:45

reporter   ~0058226

This bug is a blocker which prevents us from upgrading from Mantis 1.3.11 to Mantis 2.8.0. This bugs results in reporters being not able to upload attachments when the default bugnote view status is set to private.

jeromedl

jeromedl

2018-04-25 09:39

reporter   ~0059684

Last edited: 2018-04-25 09:42

Hi,
Just to mention that this fix is also awaited by our company (to replace a dirty hack in the core :)
For the record:
<code>
$t_user_id = auth_get_current_user_id();
$t_user_access_level = user_get_field( $t_user_id, 'access_level');
$t_attach_style = ( ($t_default_bugnote_view_status != VS_PUBLIC) && ($t_user_access_level != 25) ) ? 'display: none;' : '';
</code>

apokorski

apokorski

2019-04-15 09:13

reporter   ~0061939

Last edited: 2019-04-15 09:14

We would also like to get this attachment feature in private bugnotes but only accessible for users with a certain level of access.

Is it possible to have visibility about the implementation of this feature ?

vboctor

vboctor

2019-07-22 01:44

manager   ~0062403

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