View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0016122 | mantisbt | bugtracker | public | 2013-06-28 11:54 | 2013-07-01 03:19 |
| Reporter | MarcL | Assigned To | |||
| Priority | low | Severity | minor | Reproducibility | always |
| Status | acknowledged | Resolution | open | ||
| Product Version | 1.2.15 | ||||
| Summary | 0016122: Category is defaulted when moving issue to project inheriting fitting category | ||||
| Description | If an issue with category GUI is moved from Project A to Project B (where both have the category defined as non-global and at least Project B does not define but inherit the category), then the issue will get the configured default category, due to the changes for 0012667. A proposal to fix this: traverse the project hierarchy starting with the target project until either
| ||||
| Tags | patch | ||||
| Attached Files | 16122.patch (1,378 bytes)
diff --git a/core/bug_api.php b/core/bug_api.php
index 06bc514..f2328a1 100644
--- a/core/bug_api.php
+++ b/core/bug_api.php
@@ -1107,6 +1107,15 @@ function bug_move( $p_bug_id, $p_target_project_id ) {
// Map by name
$t_category_name = category_get_field( $t_category_id, 'name' );
$t_target_project_category_id = category_get_id_by_name( $t_category_name, $p_target_project_id, /* triggerErrors */ false );
+ while ( $t_target_project_category_id === false &&
+ !project_hierarchy_is_toplevel($p_target_project_id))
+ {
+ $p_parent_project_id = project_hierarchy_get_parent($p_target_project_id);
+ if (!project_hierarchy_inherit_parent( $p_target_project_id, $p_parent_project_id ))
+ break;
+ $p_target_project_id = $p_parent_project_id;
+ $t_target_project_category_id = category_get_id_by_name( $t_category_name, $p_target_project_id, /* triggerErrors */ false );
+ }
if ( $t_target_project_category_id === false ) {
// Use default category after moves, since there is no match by name.
$t_target_project_category_id = config_get( 'default_category_for_moves' );
| ||||