Skip to content

Commit

Permalink
Fix warnings on rendering plugin filter fields
Browse files Browse the repository at this point in the history
When registering a field through EVENT_FILTER_FIELDS plugin event,
the rendering of the filter section throws some warnings:
SYSTEM NOTICE: 'Undefined offset: 0'

Correction is made for the initialization of array variables.

Fixes #20480

Signed-off-by: Damien Regad <dregad@mantisbt.org>
  • Loading branch information
cproensa authored and dregad committed Jan 5, 2016
1 parent b53f7ca commit 0395fa0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/filter_api.php
Expand Up @@ -3010,6 +3010,7 @@ function filter_draw_selection_area2( $p_page_number, $p_for_screen = true, $p_e
$t_plugin_filter_fields = array();
$t_column_count_by_row = array();
$t_row = 0;
$t_column_count_by_row[$t_row] = 0;
foreach( $t_plugin_filters as $t_field_name=>$t_filter_object ) {
# be sure the colspan is an integer
$t_colspan = (int)$t_filter_object->colspan;
Expand All @@ -3026,6 +3027,7 @@ function filter_draw_selection_area2( $p_page_number, $p_for_screen = true, $p_e
$t_columns_available = $t_filter_cols - $t_column_count_by_row[$t_row];
if( $t_columns_available == 0 ) {
$t_row++;
$t_column_count_by_row[$t_row] = 0;
}

# see if there is room in the current row
Expand Down

0 comments on commit 0395fa0

Please sign in to comment.