Cannot delete an empty category with identical slug name

AI-generated summary

Cannot delete an empty category with identical slug name

User meke is experiencing an issue deleting an empty category with an unlocked “About” post. Despite being logged in as an admin, they receive a “You are not permitted to view the requested resource” error.

DeanMarkTaylor clarifies that the “About the {Category Name}” topic cannot be deleted, but this does not explain the issue with deleting the category itself. meke suspects a bug related to a post that was created in the category and later moved.

riking suggests checking the network inspector, which reveals a 403 Forbidden error. meke provides the request and response headers.

techAPJ discovers that the issue is caused by a sub-category with the same slug name. This issue is fixed in the latest version of Discourse, and updating should resolve the problem.

Hello, I have searched a bit and come up with a few posts, but what I am experiencing does not quite match those users reports.

So I am attempting to delete a category that has no posts except an unlocked about post. After clicking yes on the modal asking if i am sure about the deletion, I get a screen that looks like this:

With the category screen looking like:

The only thing I can think of effecting this may be that 1 topic was created there which was later moved. I imagine it is this topic creating the issue. Any suggestions on how to accomplish the removal of this category?

I should also mention that I was able to delete the subcategory that filled this category without an issue, as well as a different category which had never seen a post.

I am using v1.3.0.beta7 +35 and there are no log messages regarding this.

Thanks for any help : )

1 „Gefällt mir“

You are logged with admin account ?

1 „Gefällt mir“

Yes logged in with an admin account and able to perform all other admin privileges such as deleting and creating other categories.

check your category securty setting

I tried flipping that to a couple values, both admin only as well as everyone. Changing the security setting had no effect on the ability to delete the post; under both everyone and admin view the delete action still results in the modal view, and the message ‘You are not permitted to view the requested resource’.

You cannot delete the “About the {Category Name} category” topics:
https://meta.discourse.org/t/cant-delete-about-the-category-topics/26638/2?u=deanmarktaylor

Deleting the category though - that’s another question.

Yeah I realize I can’t delete that topic. But it seems to be a bug that I cannot delete the category. I am pretty sure it has to do with the post that was made in that category and then later moved to another that prohibits the category from being removed. Im not sure what kind of checking the platform does when it attempts to delete a category though.

delete this post :

Arduboy Buttons: How do they work?

The “you are not permitted” means that the server is replying with a 403 for some reason. What does the network inspector show?

@Qasem_h, Good thought I could see how that might be a solution, it would be nice to not have to recreate the post though, but that is an option.

@riking:

Request headers

Host: community.arduboy.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
X-CSRF-Token: z+2Exf2bEus32p8TN6HCrmWXyHllYZO3GX/20E/rVIU=
X-Requested-With: XMLHttpRequest
Referer: http://community.arduboy.com/c/development
Cookie: _t=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXxXX; _forum_session=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXxXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx%3D--6f4733a5aedf5f863823e662be83bd85297e6877; destination_url=http%3A%2F%2Fcommunity.arduboy.com%2Fdirectory_items%3Fperiod%3Dweekly%26order%3Dlikes_received%26_%3D1431377306013; __profilin=p%3Dt
Connection: keep-alive

Response headers

Connection: keep-alive
Content-Encoding: gzip
Content-Type: application/json; charset=utf-8
Date: Mon, 11 May 2015 22:01:39 GMT
Server: nginx
Set-Cookie: _forum_session=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXxXXXXXXXXXXXXXXXXXXXXXXXXx%3D--d57d08c3217046c999685e78032e72bbb7162f51; path=/; HttpOnly
__profilin=p%3Dt; path=/
__profilin=p%3Dt; path=/
Transfer-Encoding: chunked
Vary: Accept-Encoding
X-Frame-Options: SAMEORIGIN
X-Request-Id: e01a8c8a-3f68-4432-8824-8d1845a31c78
X-Runtime: 0.012455
X-XSS-Protection: 1; mode=block
status: 403 Forbidden
x-content-type-options: nosniff

Thanks Riking, I wasn’t sure about that.

Welp, I will just go ahead and make the category non-visible to members. That will be close enough.

Is there any other category/sub-category present which has same slug “development”?

3 „Gefällt mir“

Ineed there is a sub category with the same name.

Okay, then this issue is fixed via:

https://github.com/discourse/discourse/commit/836c7b4251617872727d3b4a77cb5b73715c344d

Update to the latest version and try deleting the category again.

2 „Gefällt mir“