Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Project filters: fix preselection of current filter

The strict type checking for check_selected must be disabled when
dealing with projects/subprojects selection lists display. The
alternative (strict checks + type casts) prevents the current filter
from being preselected when editing it.
  • Loading branch information...
commit 0028eff08bfc6c10764ea9802e07025dd6254133 1 parent 9344965
@dregad dregad authored
Showing with 4 additions and 4 deletions.
  1. +1 −1  core/filter_api.php
  2. +3 −3 core/print_api.php
View
2  core/filter_api.php
@@ -4344,7 +4344,7 @@ function print_filter_project_id() {
<!-- Project -->
<select <?php echo $t_select_modifier;?> name="<?php echo FILTER_PROPERTY_PROJECT_ID;?>[]">
<option value="<?php echo META_FILTER_CURRENT ?>"
- <?php check_selected( $t_filter[FILTER_PROPERTY_PROJECT_ID], META_FILTER_CURRENT, false );?>>
+ <?php check_selected( $t_filter[FILTER_PROPERTY_PROJECT_ID], META_FILTER_CURRENT );?>>
[<?php echo lang_get( 'current' )?>]
</option>
<?php print_project_option_list( $t_filter[FILTER_PROPERTY_PROJECT_ID] )?>
View
6 core/print_api.php
@@ -551,7 +551,7 @@ function print_project_option_list( $p_project_id = null, $p_include_all_project
if( $p_include_all_projects && $p_filter_project_id !== ALL_PROJECTS ) {
echo '<option value="' . ALL_PROJECTS . '"';
if ( $p_project_id !== null ) {
- check_selected( (int)$p_project_id, ALL_PROJECTS, false );
+ check_selected( $p_project_id, ALL_PROJECTS, false );
}
echo '>' . lang_get( 'all_projects' ) . '</option>' . "\n";
}
@@ -563,7 +563,7 @@ function print_project_option_list( $p_project_id = null, $p_include_all_project
}
echo '<option value="' . $t_id . '"';
- check_selected( (int)$p_project_id, $t_id );
+ check_selected( $p_project_id, $t_id, false );
check_disabled( $t_id == $p_filter_project_id || !$t_can_report );
echo '>' . string_attribute( project_get_field( $t_id, 'name' ) ) . '</option>' . "\n";
print_subproject_option_list( $t_id, $p_project_id, $p_filter_project_id, $p_trace, $p_can_report_only );
@@ -591,7 +591,7 @@ function print_subproject_option_list( $p_parent_id, $p_project_id = null, $p_fi
}
echo '<option value="' . $t_full_id . '"';
- check_selected( (string)$p_project_id, (string)$t_full_id );
+ check_selected( $p_project_id, $t_full_id, false );
check_disabled( $t_id == $p_filter_project_id || !$t_can_report );
echo '>'
. str_repeat( '&#160;', count( $p_parents ) )
Please sign in to comment.
Something went wrong with that request. Please try again.