Can't modify or delete category

AI-generated summary

Can’t modify or delete category

aymeric is experiencing issues with editing or deleting a category in his Discourse installation. As an administrator, he gets a 404 error whenever he tries to modify or delete the category. He has tried rebuilding the app without success.

pfaffman suspects that the issue might be related to the uncategorized category, but aymeric confirms that it’s a different category.

pfaffman suggests a possible solution by deleting the category directly from the server, while Benjamin_D provides a more detailed solution by updating the category slug using the Rails console.

aymeric confirms that the solution works and suspects that the issue is due to an accent in the slug. Benjamin_D suggests checking the slug generation method setting, which is currently set to ASCII (aymeric).

riking recommends trying to set the slug generation method to encoded to see if it resolves the issue.

Hello,
I installed Discourse a few weeks ago for an association. The whole works well overall.
I am an administrator and I have appointed other administrators and moderators. Another administrator created a category and subsequently renamed it.
We want to edit the category, give it another name or delete it, but I get a 404 error every time.
I launched a ./launcher rebuild app without success.
Do you have an idea ?
Thanks,
Aymeric

Did they rename uncategorized?

No, it’s different name.

I saw somewhere a method to delete a subject from the server directly in SSH, could a similar method apply for categories?

https://meta.discourse.org/t/how-can-i-delete-a-topic-permanently/138321/2

I still think it’s uncategorized that now has a different name.

But yes you can do something like

   Category.find_by(name: "ffd").destroy!

I’m guessing some accent in the slug, I had to
./launcher enter app
then
rails c
and
c = Category.find_by(id: 'the_id')
(q)
c.update(slug: 'new-slug')

exit and exit
Modify Category page was then accessible

Hi, it work !!! Thanks @Benjamin_D, @pfaffman !
I think problem is accent in slug. Problem will repeat when use accent in slug ?

:thinking: what is your slug generation method setting ?

It’s automatic when you assign a name on new category. I think he created category with “slug” name “pour améliorer la communication du site des adhérents du CA” and he rename after “communication vélivélo”.

I mean the parameter, it could be set to ascii or encoded (then something might not work, but I’m not really sure of the expected results and consequences of either one :sweat_smile:)

I do not know at all. I don’t know where the parameter is. I was thinking of using UTF8.

It is there:
your.domain/admin/site_settings/category/all_results?filter=slug

Hi, it’s ASCII. I never modify this.

Try setting it to encoded and see if that allows you to edit the category.