diff --git a/bugnote_view_inc.php b/bugnote_view_inc.php
index 31ef142349..a136b3357f 100644
--- a/bugnote_view_inc.php
+++ b/bugnote_view_inc.php
@@ -308,14 +308,6 @@
if( isset( $t_activity['attachments'] ) && count( $t_activity['attachments'] ) > 0 ) {
echo '
';
-
- if ( !$t_security_token_attachments_delete ) {
- $t_security_token_attachments_delete = form_security_token( 'bug_file_delete' );
- }
-
- foreach( $t_activity['attachments'] as $t_attachment ) {
- print_bug_attachment( $t_attachment, $t_security_token_attachments_delete );
- }
}
} else {
if ( !$t_security_token_attachments_delete ) {
@@ -324,6 +316,16 @@
print_bug_attachment( $t_activity['attachment'], $t_security_token_attachments_delete );
}
+
+ if( isset( $t_activity['attachments'] ) && count( $t_activity['attachments'] ) > 0 ) {
+ if ( !$t_security_token_attachments_delete ) {
+ $t_security_token_attachments_delete = form_security_token( 'bug_file_delete' );
+ }
+
+ foreach( $t_activity['attachments'] as $t_attachment ) {
+ print_bug_attachment( $t_attachment, $t_security_token_attachments_delete );
+ }
+ }
?>
diff --git a/core/bug_activity_api.php b/core/bug_activity_api.php
index 6c11be01ab..a67d59b0b9 100644
--- a/core/bug_activity_api.php
+++ b/core/bug_activity_api.php
@@ -228,11 +228,10 @@ function bug_activity_combine( $p_entries ) {
foreach( $p_entries as $t_activity ) {
if( $t_last_entry != null ) {
if( $t_last_entry['user_id'] == $t_activity['user_id'] &&
- $t_last_entry['type'] == ENTRY_TYPE_NOTE &&
$t_activity['type'] == ENTRY_TYPE_ATTACHMENT &&
abs( $t_activity['timestamp'] - $t_last_entry['timestamp'] ) <=
$t_threshold_in_seconds ) {
- $t_last_entry['attachments'][] = $t_activity['attachment'];
+ $t_last_entry['attachments'][] = $t_activity['attachment'];
} else {
$t_combined_entries[] = $t_last_entry;
$t_last_entry = $t_activity;