Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9ddbfae

Browse files
committedNov 20, 2012
SOAP API: only reference the global default category if it exists
Fixes #15222: mc_project_delete_category fails to delete category
1 parent e4d4f1b commit 9ddbfae

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎api/soap/mc_project_api.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,12 @@ function mc_project_delete_category ($p_username, $p_password, $p_project_id, $p
164164
// find the id of the category
165165
$p_category_id = category_get_id_by_name( $p_category_name, $p_project_id );
166166

167-
// delete the category and link all the issue to the general category by default
168-
return category_remove( $p_category_id, 1 );
167+
// delete the category and link all the issue to the general category if available
168+
$t_dest_category_id = 1;
169+
if ( !category_exists( $t_dest_category_id ) ) {
170+
$t_dest_category_id = 0;
171+
}
172+
return category_remove( $p_category_id, $t_dest_category_id );
169173
}
170174

171175
/**

0 commit comments

Comments
 (0)
Please sign in to comment.