Skip to content

Commit 10ac96e

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 ff2e650 commit 10ac96e

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
@@ -163,8 +163,12 @@ function mc_project_delete_category ($p_username, $p_password, $p_project_id, $p
163163
// find the id of the category
164164
$p_category_id = category_get_id_by_name( $p_category_name, $p_project_id );
165165

166-
// delete the category and link all the issue to the general category by default
167-
return category_remove( $p_category_id, 1 );
166+
// delete the category and link all the issue to the general category if available
167+
$t_dest_category_id = 1;
Has a conversation. Original line has a conversation.
168+
if ( !category_exists( $t_dest_category_id ) ) {
169+
$t_dest_category_id = 0;
170+
}
171+
return category_remove( $p_category_id, $t_dest_category_id );
168172
}
169173

170174
/**

0 commit comments

Comments
 (0)
Please sign in to comment.