Unable to delete category (error 1504)

Get help from other users here.

Moderators: Contributor, Developer

Unable to delete category (error 1504)

Postby mark100net » Nov 12, 2012 5:45 pm

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
mark100net
 
Posts: 4
Joined: Jul 29, 2005 11:56 am

Re: Unable to delete category (error 1504)

Postby atrol » Nov 13, 2012 2:46 pm

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
Use Mantis2Go to try MantisBT on Windows or to reproduce issues
atrol
Site Admin
 
Posts: 4753
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: Unable to delete category (error 1504)

Postby mark100net » Nov 13, 2012 4:19 pm

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.
mark100net
 
Posts: 4
Joined: Jul 29, 2005 11:56 am

Re: Unable to delete category (error 1504)

Postby atrol » Nov 13, 2012 4:30 pm

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
Use Mantis2Go to try MantisBT on Windows or to reproduce issues
atrol
Site Admin
 
Posts: 4753
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: Unable to delete category (error 1504)

Postby bjoern » Feb 26, 2013 11:59 am

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
bjoern
 
Posts: 2
Joined: Feb 26, 2013 11:48 am

Re: Unable to delete category (error 1504)

Postby atrol » Feb 26, 2013 2:51 pm

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
Use Mantis2Go to try MantisBT on Windows or to reproduce issues
atrol
Site Admin
 
Posts: 4753
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: Unable to delete category (error 1504)

Postby bjoern » Feb 27, 2013 3:25 am

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
bjoern
 
Posts: 2
Joined: Feb 26, 2013 11:48 am


Return to Help

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 6 guests