Can't delete empty, non-special category as admin


(Daniel Davis) #1

Version: v1.6.0.beta8 +30

I’ve searched for similar problems but not found a working solution.

I have a top-level category, Test, within which I created a few topics and tried pinning, unlisting, archiving them, etc.

I then deleted these topics but am unable to delete the category. The dialog message shows the topic count to be 1 but all I can see is the standard About topic (see screenshot).

Is there are a way to display the remaining topic so I can delete it? I don’t have direct command-line or database access by the way.

Thanks in advance.


(Daniel Davis) #2

I’ve tried renaming the category, adding and deleting more topics but just can’t get that topic count below 1 to be able to delete the category.

I don’t know what else to try - any ideas anyone?


#3

I can see 1 topic shown in your screenshot: “About the Test category”. Can you reopen/delete that topic?


(Mittineague) #4

The server.en.yml file has

    cannot_delete:
      uncategorized: "Can't delete Uncategorized"
      has_subcategories: "Can't delete this category because it has sub-categories."
      topic_exists:
        one: "Can't delete this category because is has 1 topic. Oldest topic is %{topic_link}."
        other: "Can't delete this category because it has %{count} topics. Oldest topic is %{topic_link}."
      topic_exists_no_oldest: "Can't delete this category because topic count is %{count}."

Notice the message you are getting is for the “no oldest”

As soon as a category is created, an “About the _____ category” topic is created.

To access it you need to go to “Categories” then o the category.

You should see the “About” there.


#5

I think you literally posted this about 5 seconds after my reply… can you delete the “About the Test category” post?


(Daniel Davis) #6

@romdos @Mittineague Thanks but I tried that. The “About” topic one of the default topics for each category and so can’t be deleted. Other categories I’ve tried could be deleted even with the “About” topic still there, and it’s not usually included in the topic count for category removal.


(Mittineague) #7

I see what you mean.

No Delete options are available via the Admin wrench.

And when I tried recategorize it to move it to a different category, no error message, but it had no effect.

It may be the only way is to run a DELETE query, But that seems very risky in that if done incorrectly it might break things.

I think the safest thing to do would be leave it, but change the permissions so nobody can see / reply / create the category and Unlist its About topic.

You will still know it’s there (in the database), but effectively it will be gone.


(Daniel Davis) #8

Thanks for the ideas. I don’t have direct database access but even so, I agree doing something like that is a bit risky.

Using permissions is a great idea so I’ve made it admin only. That way I can still use it for testing as I get used to Discourse.

Still seems like a bug somehow but I can’t figure out what happened to be able to reproduce and report it.


(Kane York) #9

Is it possible there’s a deleted topic still using the category?