404 when trying to edit category with accent in slug

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.

=> #<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.

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

1 Like

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.

1 Like