From af213f1b58892657587900b7d58292376ba62bd7 Mon Sep 17 00:00:00 2001 From: Betsy Gamrat Date: Sun, 22 Oct 2017 10:07:26 -0700 Subject: [PATCH] Allow parent issues to be closed with open children Add a config option to allow closing parent issues while children are open. Fixes #21225 --- bug_update.php | 7 ++++--- config_defaults_inc.php | 7 +++++++ docbook/Admin_Guide/en-US/config/status.xml | 9 +++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/bug_update.php b/bug_update.php index f9a1304e4f..f5f1029a6e 100644 --- a/bug_update.php +++ b/bug_update.php @@ -165,10 +165,11 @@ } } -# If resolving or closing, ensure that all dependent issues have been resolved. +# If resolving or closing, ensure that all dependent issues have been resolved +# unless config option enables closing parents with open children. if( ( $t_resolve_issue || $t_close_issue ) && - !relationship_can_resolve_bug( $f_bug_id ) -) { + !relationship_can_resolve_bug( $f_bug_id ) && + OFF == config_get( 'allow_parent_of_unresolved_to_close' ) ) { trigger_error( ERROR_BUG_RESOLVE_DEPENDANTS_BLOCKING, ERROR ); } diff --git a/config_defaults_inc.php b/config_defaults_inc.php index 3a097bb73f..2833c477f4 100644 --- a/config_defaults_inc.php +++ b/config_defaults_inc.php @@ -1315,6 +1315,12 @@ */ $g_default_bug_relationship_clone = BUG_REL_NONE; +/** + * Allow parent bug to close regardless of child status. + * @global integer $g_allow_parent_of_unresolved_to_close + */ +$g_allow_parent_of_unresolved_to_close = OFF; + /** * Default for new bug relationships * @global integer $g_default_bug_relationship @@ -4217,6 +4223,7 @@ 'allow_file_upload', 'allow_freetext_in_profile_fields', 'allow_no_category', + 'allow_parent_of_unresolved_to_close', 'allow_permanent_cookie', 'allow_reporter_close', 'allow_reporter_reopen', diff --git a/docbook/Admin_Guide/en-US/config/status.xml b/docbook/Admin_Guide/en-US/config/status.xml index ff0f664d6e..d0904a3a1d 100644 --- a/docbook/Admin_Guide/en-US/config/status.xml +++ b/docbook/Admin_Guide/en-US/config/status.xml @@ -228,6 +228,15 @@ + + $g_allow_parent_of_unresolved_to_close + + If set, no check is performed on the status of a bug's children, + which allows the parent to be closed whether or not the children + have been resolved. The default is OFF. + + + See also: