# 404 when trying to edit category with accent in slug

**URL:** https://meta.discourse.org/t/404-when-trying-to-edit-category-with-accent-in-slug/214762
**Category:** Support
**Created:** [January 13, 2022, 4:39pm UTC](https://meta.discourse.org/t/404-when-trying-to-edit-category-with-accent-in-slug/214762 "2022-01-13T16:39:09Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![saquetim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saquetim/32/116400_2.png) [@saquetim](https://meta.discourse.org/u/saquetim)
#### Post date: [January 13, 2022, 4:39pm UTC](https://meta.discourse.org/t/404-when-trying-to-edit-category-with-accent-in-slug/214762/1 "2022-01-13T16:39:09Z")

</div>

Hi, I’ve accidentally created a new category with an accent in the slug and the settings below. After creating this category, clicking on the “Edit Button” in the new category was redirecting to the 404 page.

```plaintext
=> #<Category:0x00005624cbc90838
 id: 182,
 name: "Sugestões",
 color: "F7941D",
 topic_id: 257800,
 topic_count: 0,
 created_at: Thu, 13 Jan 2022 16:11:40.677256000 UTC +00:00,
 updated_at: Thu, 13 Jan 2022 16:11:40.677256000 UTC +00:00,
 user_id: 2,
 topics_year: 0,
 topics_month: 0,
 topics_week: 0,
 slug: "sugest%C3%B5es",
 description: nil,
 text_color: "FFFFFF",
 read_restricted: false,
 auto_close_hours: nil,
 post_count: 0,
 latest_post_id: nil,
 latest_topic_id: nil,
 position: 149,
 parent_category_id: nil,
 posts_year: 0,
 posts_month: 0,
 posts_week: 0,
 email_in: nil,
 email_in_allow_strangers: false,
 topics_day: 0,
 posts_day: 0,
 allow_badges: true,
 name_lower: "sugestões",
 auto_close_based_on_last_post: false,
 topic_template: nil,
 contains_messages: nil,
 sort_order: "votes",
 sort_ascending: true,
 uploaded_logo_id: nil,
 uploaded_background_id: nil,
 topic_featured_link_allowed: true,
 all_topics_wiki: false,
 show_subcategory_list: true,
 num_featured_topics: 3,
 default_view: "top",
 subcategory_list_style: "boxes",
 default_top_period: "all",
 mailinglist_mirror: false,
 minimum_required_tags: 0,
 navigate_to_first_post_after_read: false,
 search_priority: 0,
 allow_global_tags: false,
 reviewable_by_group_id: nil,
 required_tag_group_id: nil,
 min_tags_from_required_group: 1,
 read_only_banner: "",
 default_list_filter: "all",
 allow_unlimited_owner_edits_on_first_post: false>

```

I’ve managed to fix the problem entering the rails console and changing the slug to remove the accent.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [January 13, 2022, 4:55pm UTC](https://meta.discourse.org/t/404-when-trying-to-edit-category-with-accent-in-slug/214762/2 "2022-01-13T16:55:20Z")

</div>

I believe setting the `slug generation method` setting to ‘encoded’ can help with that:

 ![slug generation method](https://global.discourse-cdn.com/meta/original/3X/a/c/ac00105fe9cd4c560ce59a3ca3dc8ac7b1db6004.jpeg)

---

<div class="post-metadata">

### Author: ![saquetim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saquetim/32/116400_2.png) [@saquetim](https://meta.discourse.org/u/saquetim)
#### Post date: [January 13, 2022, 5:06pm UTC](https://meta.discourse.org/t/404-when-trying-to-edit-category-with-accent-in-slug/214762/3 "2022-01-13T17:06:16Z")

</div>

This setting is set to `ascii` in my instance since I don’t really want accents in the slugs,

But in I’ve accidentally misplaced the text fields and typed the name (with the accent) in the slug text field. Which I think overrode the generated one.

Then after that, I could not enter the edit page of the category by clicking on the Edit button.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 18, 2022, 1:51am UTC](https://meta.discourse.org/t/404-when-trying-to-edit-category-with-accent-in-slug/214762/4 "2022-03-18T01:51:51Z")

</div>

Was this issue created via the UI or did you use the console to make the slug change? Can you repro the issue, should we recategorize as #Contribute > Bug ?

---

<div class="post-metadata">

### Author: ![saquetim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saquetim/32/116400_2.png) [@saquetim](https://meta.discourse.org/u/saquetim)
#### Post date: [March 18, 2022, 1:56am UTC](https://meta.discourse.org/t/404-when-trying-to-edit-category-with-accent-in-slug/214762/5 "2022-03-18T01:56:57Z")

</div>

The issue was create in the UI @sam, I submit a PR to fix it.

[https://github.com/discourse/discourse/pull/15702](https://github.com/discourse/discourse/pull/15702)

It is already merged so the problem is fixed. Sorry I forgot to update the topic.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 18, 2022, 1:57am UTC](https://meta.discourse.org/t/404-when-trying-to-edit-category-with-accent-in-slug/214762/6 "2022-03-18T01:57:53Z")

</div>

Oh awesome @saquetim

Thanks so much.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [April 17, 2022, 1:58am UTC](https://meta.discourse.org/t/404-when-trying-to-edit-category-with-accent-in-slug/214762/7 "2022-04-17T01:58:16Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
