From 8bf578ed63e39752d684f37ac5e9861fa032b761 Mon Sep 17 00:00:00 2001 From: Roland Becker Date: Sun, 17 Jan 2021 13:34:00 +0100 Subject: [PATCH] Use config_get_global to access subprojects_enabled Issue #27884 --- core/commands/ProjectHierarchyAddCommand.php | 2 +- core/commands/ProjectHierarchyDeleteCommand.php | 2 +- core/commands/ProjectHierarchyUpdateCommand.php | 2 +- core/print_api.php | 2 +- manage_proj_edit_page.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/commands/ProjectHierarchyAddCommand.php b/core/commands/ProjectHierarchyAddCommand.php index d773baf4fd..4a194d763b 100644 --- a/core/commands/ProjectHierarchyAddCommand.php +++ b/core/commands/ProjectHierarchyAddCommand.php @@ -58,7 +58,7 @@ function __construct( array $p_data ) { * Validate the data. */ function validate() { - if ( config_get( 'subprojects_enabled' ) == OFF ) { + if ( config_get_global( 'subprojects_enabled' ) == OFF ) { throw new ClientException( 'Project hierarchy (subprojects) is disabled', ERROR_PROJECT_HIERARCHY_DISABLED ); diff --git a/core/commands/ProjectHierarchyDeleteCommand.php b/core/commands/ProjectHierarchyDeleteCommand.php index fda02cbfa9..3c18b473a1 100644 --- a/core/commands/ProjectHierarchyDeleteCommand.php +++ b/core/commands/ProjectHierarchyDeleteCommand.php @@ -53,7 +53,7 @@ function __construct( array $p_data ) { * Validate the data. */ function validate() { - if ( config_get( 'subprojects_enabled' ) == OFF ) { + if ( config_get_global( 'subprojects_enabled' ) == OFF ) { throw new ClientException( 'Project hierarchy (subprojects) is disabled', ERROR_PROJECT_HIERARCHY_DISABLED ); diff --git a/core/commands/ProjectHierarchyUpdateCommand.php b/core/commands/ProjectHierarchyUpdateCommand.php index 9049e1226f..2908995c91 100644 --- a/core/commands/ProjectHierarchyUpdateCommand.php +++ b/core/commands/ProjectHierarchyUpdateCommand.php @@ -61,7 +61,7 @@ function __construct( array $p_data ) { * Validate the data. */ function validate() { - if ( config_get( 'subprojects_enabled' ) == OFF ) { + if ( config_get_global( 'subprojects_enabled' ) == OFF ) { throw new ClientException( 'Project hierarchy (subprojects) is disabled', ERROR_PROJECT_HIERARCHY_DISABLED ); diff --git a/core/print_api.php b/core/print_api.php index a4104f3450..911a4d889c 100644 --- a/core/print_api.php +++ b/core/print_api.php @@ -643,7 +643,7 @@ function print_project_option_list( $p_project_id = null, $p_include_all_project * @return void */ function print_subproject_option_list( $p_parent_id, $p_project_id = null, $p_filter_project_id = null, $p_trace = false, $p_can_report_only = false, array $p_parents = array() ) { - if ( config_get( 'subprojects_enabled' ) == OFF ) { + if ( config_get_global( 'subprojects_enabled' ) == OFF ) { return; } diff --git a/manage_proj_edit_page.php b/manage_proj_edit_page.php index 3634a9ab2e..763d671311 100644 --- a/manage_proj_edit_page.php +++ b/manage_proj_edit_page.php @@ -227,7 +227,7 @@