Skip to content

Commit

Permalink
Fix category not found error when reporting bug
Browse files Browse the repository at this point in the history
Regression introduced by 0f302a8
  • Loading branch information
dregad committed Feb 18, 2024
1 parent b8d2f12 commit 290f988
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/print_api.php
Expand Up @@ -774,7 +774,9 @@ function print_category_option_list( $p_category_id = 0, $p_project_id = null, $
$t_cat_arr = category_get_all_rows( $t_project_id, null, true, $p_enabled_only );

# Add the current category if it is not in the list
if( !in_array( $p_category_id, array_column( $t_cat_arr, 'id' ) ) ) {
if( $p_category_id != 0
&& !in_array( $p_category_id, array_column( $t_cat_arr, 'id' ) )
) {
$t_category_row = category_get_row( $p_category_id );
$t_category_row['project_name'] = project_get_name( $t_category_row['project_id'] );
$t_cat_arr[] = $t_category_row;
Expand Down Expand Up @@ -808,7 +810,7 @@ function print_category_option_list( $p_category_id = 0, $p_project_id = null, $
$t_category_row['project_id'] != $t_project_id
);
if( $t_disabled ) {
$t_category_name .= ' [' . lang_get( 'disabled' ) . ']';
// $t_category_name .= ' [' . lang_get( 'disabled' ) . ']';
}
echo '<option value="' . $t_category_id . '"';
check_selected( $p_category_id, $t_category_id );
Expand Down

0 comments on commit 290f988

Please sign in to comment.