Skip to content

Commit

Permalink
Support db config for 'default_category_for_moves'
Browse files Browse the repository at this point in the history
Fixes #20197
  • Loading branch information
vboctor committed Oct 17, 2015
1 parent e6873b3 commit 04a027b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions manage_proj_cat_delete.php
Expand Up @@ -66,10 +66,10 @@
access_ensure_project_level( config_get( 'manage_project_threshold' ), $t_project_id );

# Protect the 'default category for moves' from deletion
$t_default_cat = 'default_category_for_moves';
$t_default_category_id = config_get( 'default_category_for_moves', /* default */ null, ALL_USERS, ALL_PROJECTS );
$t_query = 'SELECT count(config_id) FROM {config} WHERE config_id = ' . db_param() . ' AND value = ' . db_param();
$t_default_cat_count = db_result( db_query( $t_query, array( $t_default_cat, $f_category_id ) ) );
if( $t_default_cat_count > 0 || $f_category_id == config_get_global( $t_default_cat ) ) {
$t_default_cat_count = db_result( db_query( $t_query, array( 'default_category_for_moves', $f_category_id ) ) );
if( $t_default_cat_count > 0 || $f_category_id == $t_default_category_id ) {
trigger_error( ERROR_CATEGORY_CANNOT_DELETE_DEFAULT, ERROR );
}

Expand Down

0 comments on commit 04a027b

Please sign in to comment.