View Issue Details

IDProjectCategoryView StatusLast Update
0022323mantisbtfeaturepublic2017-02-23 12:22
Assigned To 
Status newResolutionopen 
Product Version2.1.0 
Target VersionFixed in Version 
Summary0022323: Missing whole "Attached Files" section

With all the great improvements in new MantisBT 2.x, me and my users (piloting new version with selected users) are confused about not finding "Attached Files" section, as well as central "Upload file" box (only under the 'add note' - something we have disabled in MantisBT 1.2.x). We use MantisBT more like case management system - and we use attachments extensively. People opening the case would like to see the case with all the supporting attachments. Now attachments are mixed-up with notes. It means that one needs to travel over all notes to collect attachments!? Some of our tickets have up to 200 notes and dozens of attachments. With new setup these cases are basically unmanageable - only 'small' tickets are more-or-less OK - while still not convenient.

Can we have config option to re-enable display of attachments displayed in the old way - grouped together and not scattered in "Activity" messed-up with notes?

Thank you,

TagsNo tags attached.


related to 0021727 closedvboctor Show attachments inline with notes 




2017-02-07 03:25

reporter   ~0055518

Last edited: 2017-02-22 13:07

View 3 revisions

In case you need this functionality, do the following:
add in config_inc.php, the following line:

$g_show_attachments     =   ON;

This makes it configurable, not absolutely neeeded but good practice,
Now open up bug_view_inc.php and goto line 727.
This is right after this section:

if( $t_custom_fields_found ) {
    # spacer
    echo '<tr class=&quot;spacer&quot;><td colspan=&quot;6&quot;></td></tr>';
    echo '<tr class=&quot;hidden&quot;></tr>';

Just behind this section, add the following code:

# Attachments
if ( ON == config_get('show_attachments') ) {
    echo '<tr ', helper_alternate_class(), '>';
    echo '<td class=&quot;category&quot;><a name=&quot;attachments&quot; id=&quot;attachments&quot; />', lang_get( 'attached_files' ), '</td>';
    echo '<td colspan=&quot;5&quot;>';
    print_bug_attachments_list( $t_bug_id, null);
    echo '</td></tr>';

Here you are, your list is back in the main screen.



2017-02-07 03:27

reporter   ~0055519

This way it looks a bit funny because of the HTML thing.
In reality both the words 'spacer' and 'attachments' are prefixed with a '#' sign



2017-02-07 03:34

reporter   ~0055520

Last edited: 2017-02-07 05:32

View 2 revisions

Changed 2 more lines to be in line with new lay-out, so it should read:

if ( ON == config_get('show_attachments') ) {
    echo '<tr ', helper_alternate_class(), '>';
    echo '<th class=&quot;bug-attachments category&quot;>', lang_get( 'attached_files' ), '</th>';
    echo '<td class=&quot;bug-attachments&quot; colspan=&quot;5&quot;>';
    print_bug_attachments_list( $t_bug_id, null);
    echo '</td></tr>';


2017-02-07 05:20

reporter   ~0055521

Thanks a lot! Works nicely.

Users can possibly use file attach under the 'add note' - doesn't seem to be a big problem. The only missing thing is date next to the attached file, but I looked into functions - it is removed in version 2.x so 'hack' needs to be deeper. My users would possible agree to live without date displayed in this box.

Can these changes be made part of next release?



2017-02-07 05:39

developer   ~0055523

@cas I edited your notes to add the markdown formatting so the code is displayed raw.

It was the decision of @vboctor to handle attachments upload and display at note level moving forward, so I let him comment on the eventuality of adding back the notion of "issue-level" attachments.

I have to say that I personally do not like the fact that a document uploaded as part of an issue's initial report appears as a separate bug note; this is made worse by the fact that I like to have notes sorted reverse (most recent first), so the initial attachments appear last.

It's worth mentioning that the current data model would not allow us to differentiate a note vs an issue attachment (currently this is an arbitrary link is based on the upload timestamp).



2017-02-07 06:37

reporter   ~0055527

@aavagyan, it makes sense that the date is taken away since that is visible within the note. Can be added but most likely then also will show up within the note which is not desirable.
@dregad, would agree with you, that is why I dived into this since I have the same wish. Not being able to distinguish between note vs issue attachment does not bother me too much. It is still visible within the notes.
@vboctor, I do understand where you are coming from, that is why I made the switch. Why not incorporate with default switch set to OFF? Saves us from hacking each version and more people happy (overal this version 2 is a step in the right direction anyway).



2017-02-07 06:44

reporter   ~0055528

I strongly believe that "ticket" or "issue" or "case" (no matter what is the term used) needs to have the main information, with supporting documentation (files) as "core" informational unit, whereas notes and the rest (e.g. change-sets, time-tracking info, issue log, etc.), can be appended to it as needed. It looks like it can be achieved more or less easily by displaying "File attachments" block. Config option would be even better to satisfy different needs, e.g.:

  • option 1: show attachments only centrally (don't know if central 'upload' is needed or "upload-in-note" is OK);
  • option 2: show attachment centrally, but also as "activity" item;
  • option 3: show attachments only as "activity" item.

"Mantis Bug Tracker is a free and open source, web-based bug tracking system. The most common use of MantisBT is to track software defects. However, MantisBT is often configured by users to serve as a more generic issue tracking system and project management tool."

I think that change is especially needed if we would like to keep last sentence valid.



2017-02-09 05:11

reporter   ~0055610

This is something that my department would also like to see reinstated. I agree with @aavagyan that for use as a project management tool having all attachments collated within one area is immensely useful.

When uploading items such as: functional or business requirements, this could prove quite costly if they were missed. This is more likely to occur if they are 'hidden' away within the notes/activities section.

A configuration option would be ideal.



2017-02-09 05:13

reporter   ~0055611

@cas I will test out those options on a test build of Mantis. Thank you for the effort.



2017-02-10 10:51

reporter   ~0055643

Discovered small glitch with this fix. Opening inline (+ sign) shows image in the top-block and not showing it in 'activity' block...



2017-02-17 10:35

reporter   ~0055718

The fix provided above works great, except that the details are coming on multiple lines as shown in the attachment here. Is there a way to make the details come on one line?

AttachedFiles.JPG (88,216 bytes)
AttachedFiles.JPG (88,216 bytes)


2017-02-22 12:46

reporter   ~0055748

Just change this line:
echo '<td class="bug-attachments" colspan="5">';
echo '<td class="bug-attachments" colspan="7">';

Should do the trick!



2017-02-22 13:11

developer   ~0055749

in 0022323:0055518

echo '<tr ', helper_alternate_class(), '>';

Please note that helper_alternate_class() function is deprecated and will be removed in a future version of MantisBT



2017-02-23 11:07

reporter   ~0055767

Last edited: 2017-02-23 12:22

View 2 revisions

In order to be future compliant, I think that the line:
echo '<tr ', helper_alternate_class(), '>';
should read:
echo '<tr class="bug-attachments">';
So, the correct adjustment would be:

# Attachments
if ( ON == config_get('show_attachments') ) {
   echo '<tr class=&quot;bug-attachments&quot;>';
    echo '<td class=&quot;category&quot;><a name=&quot;attachments&quot; id=&quot;attachments&quot;>', lang_get( 'attached_files' ), '</td>';
    echo '<td class=&quot;bug-attachments&quot; colspan=&quot;7&quot;>';
    print_bug_attachments_list( $t_bug_id, null);
    echo '</td></tr>';

Issue History

Date Modified Username Field Change
2017-02-06 09:37 aavagyan New Issue
2017-02-06 09:48 atrol Relationship added related to 0021727
2017-02-07 03:25 cas Note Added: 0055518
2017-02-07 03:27 cas Note Added: 0055519
2017-02-07 03:34 cas Note Added: 0055520
2017-02-07 05:20 aavagyan Note Added: 0055521
2017-02-07 05:31 dregad Note Edited: 0055518 View Revisions
2017-02-07 05:32 dregad Note Edited: 0055520 View Revisions
2017-02-07 05:39 dregad Note Added: 0055523
2017-02-07 06:37 cas Note Added: 0055527
2017-02-07 06:44 aavagyan Note Added: 0055528
2017-02-09 05:11 dnewman Note Added: 0055610
2017-02-09 05:13 dnewman Note Added: 0055611
2017-02-10 10:51 aavagyan Note Added: 0055643
2017-02-17 10:35 udaymantis File Added: AttachedFiles.JPG
2017-02-17 10:35 udaymantis Note Added: 0055718
2017-02-22 12:46 cas Note Added: 0055748
2017-02-22 13:07 dregad Note Edited: 0055518 View Revisions
2017-02-22 13:11 dregad Note Added: 0055749
2017-02-23 11:07 cas Note Added: 0055767
2017-02-23 12:22 dregad Note Edited: 0055767 View Revisions