Continued from: Error 422 when reordering categories
I’m seeing the same error on our hosted instance (discourse.julialang.org) right now — we’d be happy to have some @staff hop on over and repro!
The discussion addresses a 422 error when reordering categories on a Discourse instance, specifically on discourse.julialang.org. mbauman reports the issue, and JammyDodger identifies the root cause: categories with slugs consisting only of numbers (e.g., “2019”) fail validation. This leads to a Slug is invalid error, preventing category reordering. mbauman confirms that the issue was resolved by manually adding valid slugs to the affected categories. The thread concludes with a suggestion to improve the error message to make it more actionable, as the current placeholder text misleadingly implies the slug is optional. JammyDodger notes similar past issues and recommends splitting the topic to focus on refining the error feedback.
Continued from: Error 422 when reordering categories
I’m seeing the same error on our hosted instance (discourse.julialang.org) right now — we’d be happy to have some @staff hop on over and repro!
I can see this in your logs ActiveRecord::RecordInvalid (Validation failed: Slug is invalid). Is there a particular category this triggers on?
Looking a bit more closely, it seems you may have a few categories without slugs. Not sure what the circumstances are there, but we’ll dig a bit deeper… ![]()
@mbauman More specifically, you had a category slug that was only numbers (2019) which didn’t pass the validation check (likely added after the category was created). I believe adjusting that has made everything come good. ![]()
Does this sound like it could be the same for you @Christina?
Fascinating — yes, I was trying to move that category’s parent placement! Note that the placeholder text for the empty category slug still states that it’s optional:

I think those ones were a red herring and actually it was the ‘only numbers’ one that was the true culprit.
The empty ones seem quite happy now that’s been changed.
Yep, I just filled in the slugs and now was able to re-arrange things once again! Thanks!
Perhaps this could get moved back over to Contribute > Bug now that the root cause is clear? In short, we had sub-categories named things like like “2020” without a filled-in slug — and then upon trying to move their parents we were getting this 422. Simply providing a customized slug fixed the issue. Seems there could now be some concrete bug fixes that could either make the error message more actionable or deal with it directly.
I can see another mention of it all the way back here:
It seems there were a few different cases mixed into that older Contribute > Bug topic. The OP of this one may not have the same issue as yours.
Let’s split yours off neatly and suggest at least making the error message more obvious in the pop up.