Unable to delete category (error 1504)

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
mark100net
Posts: 4
Joined: 29 Jul 2005, 16:56

Unable to delete category (error 1504)

Post by mark100net »

I just installed version 1.2.12.

One of the first things I did was to setup some categories. I realized categories are not what I thought, so I wanted to delete them and start over. The last one would not delete. I get this error message when I click Delete on it:

--------------------------------
APPLICATION ERROR #1504
This Category cannot be deleted, because it is defined as "Default Category For Moves".
--------------------------------

It will not delete even after I added some more categories. Surprisingly I find nothing out in the wild about this.

How do I fix this (short of deleting it directly from the DB)?

Thanks
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Unable to delete category (error 1504)

Post by atrol »

There is one predefined global category out of the box: "General"
You shouldn't remove it as you might get unexpected behavior.
MantisBT is not designed to work without categories.
Please use Search before posting and read the Manual
mark100net
Posts: 4
Joined: 29 Jul 2005, 16:56

Re: Unable to delete category (error 1504)

Post by mark100net »

It's one thing to say you can't remove the last category than to say that there is one particular category that you can never remove (which is what you can be interpreted as saying).

I have four categories and the application wouldn't let me remove one of them. I removed it directly from the DB and have no apparent problems.

This is clearly a bug.
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Unable to delete category (error 1504)

Post by atrol »

I am not able to reproduce the issue.
1. Installed fresh MantisBT 1.2.12
2. Created global category "GC"
3. Deleted global category "GC", no issue
4. Created project "P1"
5. Created local category "LC1" for project "P1"
6. Deleted local category "LC1", no issue

Please provide step by step instructions to reproduce the issue.
Please use Search before posting and read the Manual
bjoern
Posts: 2
Joined: 26 Feb 2013, 16:48

Re: Unable to delete category (error 1504)

Post by bjoern »

Hi, I can confirm this behaviour, which seems to be at least a little odd.
I can't find a way to delete the global "General" category from any of my projects (this might be a misconfiguration on my part, but I can't seem to find a way to configure a project to NOT use any of the global categories).

Even though I do have a couple of project-specific categories, I can not remove any of the global ones.

The second odd behaviour is, that I can not ever delete the "General" category from the global categories - even though there are a couple of other global categories defined.
If I try to ever remove that category, I get "APPLICATION ERROR #1504".

Reproduce:
- create new project
- create new categories within that project
- try to remove the global "General" category

OR
- create new Project
- create new global category
- try to delete the global "General" category

Maybe this does make sense in some way and I have just misconfigured my installation in some way - but then again, this is really really shady to get, how to properly configure a project so that you do NOT have to use that GENERAL category...

Best Regards,
Bjoern
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Unable to delete category (error 1504)

Post by atrol »

You can inherit all global categories in a project or none of them. Use the checkbox "Inherit Global Categories" when editing project settings.
There is no way to inherit just some of all global categories.

You can remove all global categories but not the one which is defined by $g_default_category_for_moves.
The default setting of this category is 1 which is the global category "General" in a fresh installation.

Set $g_default_category_for_moves to another value if you want to delete the global "General" category.
Please use Search before posting and read the Manual
bjoern
Posts: 2
Joined: 26 Feb 2013, 16:48

Re: Unable to delete category (error 1504)

Post by bjoern »

Thanks atrol, that made everythin much clearer.
From a user's point of view the behaviour of the 'General' category is not really clear though in my opinion, once you don't know about that PHP-variable.
There is probably a reason why that standard category for moves is not configurable through the interface (one category must be configured to be standard for moves and that category cannot be deleted).

However, the error message is quite confusing as long as you don't know that setting. Maybe it should be extended by "If you need to remove this category, please change $g_default_category_for_moves in the configuration file to another existing category".

Just my two cents. Of course a proper administrator should probably read the documentation and hence know about that setting. But I bet there are other users like me, that just used that awesome installation script and never really looked into the configuration file. Or the Administrator is not the same person that set up the installation.

Cheers and thanks again,
Bjoern
Post Reply