Skip to content

Commit

Permalink
Cache projects used in filter query
Browse files Browse the repository at this point in the history
The projects will be used to check access level, that will require
reading the project rows from database. Making sure the projects rows
are cached avoids having individual queries later for each project.
  • Loading branch information
cproensa authored and atrol committed Aug 18, 2017
1 parent 29c2912 commit 188739a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/filter_api.php
Expand Up @@ -1492,6 +1492,8 @@ function filter_get_bug_rows_query_clauses( array $p_filter, $p_project_id = nul
$t_private_and_public_project_ids = array();
$t_limited_projects = array();

# make sure the project rows are cached, as they will be used to check access levels.
project_cache_array_rows( $t_project_ids );
foreach( $t_project_ids as $t_pid ) {
# limit reporters to visible projects
if( ( ON === $t_limit_reporters ) && ( !access_has_project_level( access_threshold_min_level( config_get( 'report_bug_threshold', null, $t_user_id, $t_pid ) ) + 1, $t_pid, $t_user_id ) ) ) {
Expand Down

0 comments on commit 188739a

Please sign in to comment.