# 404 quando si tenta di modificare la categoria con accento nello slug

**URL:** <https://meta.discourse.org/t/404-when-trying-to-edit-category-with-accent-in-slug/214762>\
**Category:** Product Support\
**Created:** [13 Gennaio 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:** 1\
**Showing post:** 5

<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:** [18 Marzo 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>

Il problema è stato creato nell’interfaccia utente @sam, ho inviato una PR per risolverlo.

> <https://github.com/discourse/discourse/pull/15702>
>
> Fixes bug reported in:
> \- https://meta.discourse.org/t/404-when-trying-to-edit-c…ategory-with-accent-in-slug/214762
> \- https://meta.discourse.org/t/formatting-and-accents-in-urls/215734/5
> 
> Assuming \`SiteSetting.slug\_generation\_method == 'ascii'\`.
> 
> If the user provides a slug containing non-ascii characters while
> creating the category, the user will receive a 404 error just
> after saving the category since the slug will be escaped anyway but
> \`Category.find\_by\_slug\_path\` won't escape the category slug
> causing the Edit Page of the category to be inaccessible.
> 
> This commit checks the provided slug and raises an error if the
> provided slug contains non-ascii characters ensuring that the
> provided value is consistent with the site settings.
> 
> It also changes \`Category.find\_by\_slug\_path\` to always escape the slug,
> since if present, it is escaped anyway in \`Category.ensure\_slug\` to
> prevent the 404 in the Edit Category Page in case the user already
> have some category with a non-ascii slug.

È già stato unito, quindi il problema è risolto. Mi dispiace, ho dimenticato di aggiornare l’argomento.

---

_[View the full topic](https://meta.discourse.org/t/404-when-trying-to-edit-category-with-accent-in-slug/214762)._
