Skip to content

Commit

Permalink
Do not enforce related thresholds when sponsorship is OFF
Browse files Browse the repository at this point in the history
When $g_enable_sponsorship = OFF, we should not enforce related
thresholds ($g_handle_sponsored_bugs_threshold and
$g_assign_sponsored_bugs_threshold) when updating issues.

Fixes #21030
  • Loading branch information
dregad committed Jun 5, 2016
1 parent d3e3f4e commit 1a4ecfc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion bug_change_status_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@
$f_handler_id = gpc_get_int( 'handler_id', $t_bug->handler_id );

if( config_get( 'bug_assigned_status' ) == $f_new_status ) {
$t_bug_sponsored = sponsorship_get_amount( sponsorship_get_all_ids( $f_bug_id ) ) > 0;
$t_bug_sponsored = config_get( 'enable_sponsorship' )
&& sponsorship_get_amount( sponsorship_get_all_ids( $f_bug_id ) ) > 0;
if( $t_bug_sponsored ) {
if( !access_has_bug_level( config_get( 'assign_sponsored_bugs_threshold' ), $f_bug_id ) ) {
trigger_error( ERROR_SPONSORSHIP_ASSIGNER_ACCESS_LEVEL_TOO_LOW, ERROR );
Expand Down
3 changes: 2 additions & 1 deletion bug_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,9 @@
}

# Validate any change to the handler of an issue.
$t_issue_is_sponsored = sponsorship_get_amount( sponsorship_get_all_ids( $f_bug_id ) ) > 0;
if( $t_existing_bug->handler_id != $t_updated_bug->handler_id ) {
$t_issue_is_sponsored = config_get( 'enable_sponsorship' )
&& sponsorship_get_amount( sponsorship_get_all_ids( $f_bug_id ) ) > 0;
access_ensure_bug_level( config_get( 'update_bug_assign_threshold' ), $f_bug_id );
if( $t_issue_is_sponsored && !access_has_bug_level( config_get( 'handle_sponsored_bugs_threshold' ), $f_bug_id ) ) {
trigger_error( ERROR_SPONSORSHIP_HANDLER_ACCESS_LEVEL_TOO_LOW, ERROR );
Expand Down

0 comments on commit 1a4ecfc

Please sign in to comment.