Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Correct naming of attachments column
Commit 97b67e4 introduced some changes to the
BugData class: the 'attachment' column was renamed to 'attachment_count'. This
change was not cascaded everywhere, which resulted in the column not being
displayed by default (as the now-invalid column named 'attachment' was
automatically removed)

This then hid the fact that $g_show_attachment_indicator was actually not
working as advertised, i.e. the attachments column is always displayed; when
ON the field contains the paperclip bitmap, and when OFF the actual number of
attachments for the corresponding issue.

Affects issue #13276

This is porting d86ba72 to master
  • Loading branch information
dregad committed Oct 21, 2011
1 parent 25f2af8 commit d5a0ea7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions config_defaults_inc.php
Expand Up @@ -882,7 +882,7 @@
*/
$g_view_issues_page_columns = array (
'selection', 'edit', 'priority', 'id', 'sponsorship_total',
'bugnotes_count', 'attachment', 'category_id', 'severity', 'status',
'bugnotes_count', 'attachment_count', 'category_id', 'severity', 'status',
'last_updated', 'summary'
);

Expand All @@ -894,7 +894,8 @@
*/
$g_print_issues_page_columns = array (
'selection', 'priority', 'id', 'sponsorship_total', 'bugnotes_count',
'attachment', 'category_id', 'severity', 'status', 'last_updated', 'summary'
'attachment_count', 'category_id', 'severity', 'status', 'last_updated',
'summary'
);

/**
Expand Down
4 changes: 2 additions & 2 deletions core/filter_api.php
Expand Up @@ -620,7 +620,7 @@ function filter_ensure_valid_filter( $p_filter_arr ) {
$t_fields = helper_get_columns_to_view();
$t_n_fields = count( $t_fields );
for( $i = 0;$i < $t_n_fields;$i++ ) {
if( isset( $t_fields[$i] ) && in_array( $t_fields[$i], array( 'selection', 'edit', 'bugnotes_count', 'attachment' ) ) ) {
if( isset( $t_fields[$i] ) && in_array( $t_fields[$i], array( 'selection', 'edit', 'bugnotes_count', 'attachment_count' ) ) ) {
unset( $t_fields[$i] );
}
}
Expand Down Expand Up @@ -4043,7 +4043,7 @@ function print_filter_show_sort() {
$t_n_fields = count( $t_fields );
$t_shown_fields[''] = '';
for( $i = 0;$i < $t_n_fields;$i++ ) {
if( !in_array( $t_fields[$i], array( 'selection', 'edit', 'bugnotes_count', 'attachment' ) ) ) {
if( !in_array( $t_fields[$i], array( 'selection', 'edit', 'bugnotes_count', 'attachment_count' ) ) ) {
if( strpos( $t_fields[$i], 'custom_' ) === 0 ) {
$t_field_name = string_display( lang_get_defaulted( utf8_substr( $t_fields[$i], utf8_strlen( 'custom_' ) ) ) );
} else {
Expand Down
2 changes: 1 addition & 1 deletion core/helper_api.php
Expand Up @@ -495,7 +495,7 @@ function helper_get_columns_to_view( $p_columns_target = COLUMNS_TARGET_VIEW_PAG
}

if( $p_columns_target == COLUMNS_TARGET_CSV_PAGE || $p_columns_target == COLUMNS_TARGET_EXCEL_PAGE || OFF == config_get( 'show_attachment_indicator' ) ) {
$t_keys_to_remove[] = 'attachment';
$t_keys_to_remove[] = 'attachment_count';
}

$t_current_project_id = helper_get_current_project();
Expand Down
2 changes: 1 addition & 1 deletion view_filters_page.php
Expand Up @@ -93,7 +93,7 @@
$t_fields = helper_get_columns_to_view();
$t_n_fields = count( $t_fields );
for ( $i=0; $i < $t_n_fields; $i++ ) {
if ( in_array( $t_fields[$i], array( 'selection', 'edit', 'bugnotes_count', 'attachment' ) ) ) {
if ( in_array( $t_fields[$i], array( 'selection', 'edit', 'bugnotes_count', 'attachment_count' ) ) ) {
unset( $t_fields[$i] );
}
}
Expand Down

0 comments on commit d5a0ea7

Please sign in to comment.