View Issue Details

IDProjectCategoryView StatusLast Update
0015222mantisbtapi soappublic2013-04-06 08:26
Reportere7andy Assigned Torombert  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.12 
Target Version1.2.13Fixed in Version1.2.13 
Summary0015222: mc_project_delete_category fails to delete category
Description

Operation mc_project_delete_category returns faultstring "Error Type: APPLICATION ERROR 0001502, Error Description: Category not found." for existing categories and delete is not performed.

Operation returns the correct faulstring "Error Type: APPLICATION ERROR 0001503,
Error Description: Category "non_existing_category_name" not found for project "Project1"." for non existing categories.

TagsNo tags attached.

Relationships

related to 0014478 closeddregad The global category "General" can be deleted, but the $g_default_category_for_moves must be protected from suppression 
related to 0015226 new When deleting a Category, issues category_id is set to (No Category) 
related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 

Activities

rombert

rombert

2012-11-20 16:24

reporter   ~0034354

You have probably deleted the default category and the code tried to use it unconditionally. Now it should work but issues belonging to the deleted category will no longer have a category.

e7andy

e7andy

2012-11-21 02:21

reporter   ~0034356

Last edited: 2012-11-21 02:22

I've confirmed that I've deleted the default category (General with id 1) and that is causing the problem.
Problem solved by adding a new category and changing the id to 1.
ISSUE 0014478 has some extra info and prevents users from deleting the default category.

dregad

dregad

2012-11-21 02:48

developer   ~0034357

issues belonging to the deleted category will no longer have a category.

The code should not permit that, i.e. prevent category deletion unless $g_allow_no_category = ON;

Furthermore, IMO the code should fallback to $g_default_category_for_moves, not to an empty category (as Mantis does not allow that category to be deleted, see 0014478)

e7andy

e7andy

2012-11-21 04:58

reporter   ~0034358

Last edited: 2012-11-21 05:11

I can delete a category with issues attached to it and the issues will end up with "(No Category)" as category.

I've verified that:
General category got id = 1.
$g_allow_no_category = OFF;
$g_default_category_for_moves = 1;
The issues are connected to a project with category_id set to 1.

So, the fallback to $g_default_category_for_moves doesn't seem to work.

dregad

dregad

2012-11-21 07:33

developer   ~0034360

e7andy - as I said "code should fall back"... thanks for checking and confirming that it does not. I opened 0015226 to follow up with that

rombert

rombert

2012-11-21 13:47

reporter   ~0034361

Thanks for the heads-up ( also to atrol for spotting my initial mistake ) . I'll correct the code in the soap api in a couple of hours.

rombert

rombert

2012-11-21 15:00

reporter   ~0034362

Now falling back to default_category_for_moves

grangeway

grangeway

2013-04-05 17:56

reporter   ~0036114

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

Related Changesets

MantisBT: master 10ac96e8

2012-11-20 16:21

rombert


Details Diff
SOAP API: only reference the global default category if it exists

Fixes 0015222: mc_project_delete_category fails to delete category
Affected Issues
0015222
mod - api/soap/mc_project_api.php Diff File

MantisBT: master-1.2.x 9ddbfae8

2012-11-20 16:21

rombert


Details Diff
SOAP API: only reference the global default category if it exists

Fixes 0015222: mc_project_delete_category fails to delete category
Affected Issues
0015222
mod - api/soap/mc_project_api.php Diff File

MantisBT: master-1.2.x acd7562d

2012-11-21 14:58

rombert


Details Diff
soap api: fall back to the default_category_for_moves when deleting
categories

Fixes 0015222: mc_project_delete_category fails to delete category
Affected Issues
0015222
mod - api/soap/mc_project_api.php Diff File

MantisBT: master 4c6e6f0d

2012-11-21 14:58

rombert


Details Diff
soap api: fall back to the default_category_for_moves when deleting
categories

Fixes 0015222: mc_project_delete_category fails to delete category
Affected Issues
0015222
mod - api/soap/mc_project_api.php Diff File