スラッグにアクセント文字が含まれているカテゴリの編集時に404エラーが発生する

スラッグにアクセント文字を含む新しいカテゴリを誤って作成してしまい、以下の設定も同様でした。このカテゴリを作成した後、「編集ボタン」をクリックすると404ページにリダイレクトされました。

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

レールコンソールに入り、スラッグからアクセントを削除して問題を修正しました。

スラッグ生成方法設定を「エンコード済み」に設定すると、それが役立つと思います。

「いいね!」 3

この設定は、スラッグにアクセント文字を含めたくないため、私のインスタンスでは ascii に設定されています。

しかし、テキストフィールドを誤って配置してしまい、スラッグのテキストフィールドに(アクセント付きの)名前を入力してしまいました。これにより、生成されたものが上書きされたのだと思います。

その後、編集ボタンをクリックしても、カテゴリの編集ページに入ることができませんでした。

「いいね!」 2

この問題はUIから作成されましたか、それともコンソールを使用してスラッグを変更しましたか? 問題を再現できますか? Bug に再分類すべきでしょうか?

UIで問題が発生しました@sam。修正のためのPRを提出しました。

すでにマージされたので、問題は解決しました。トピックの更新を忘れて申し訳ありません。

「いいね!」 1

素晴らしい @saquetim

本当にありがとうございます。

「いいね!」 1

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