FIX: Validate category name on parent change (PR #10815)

Previously, moving a category into another one, that already had a child category of that name (but with a non-conflicting slug) would cause a 500 error:

# PG::UniqueViolation:
#   ERROR:  duplicate key value violates unique constraint "unique_index_categories_on_name"
#   DETAIL:  Key (COALESCE(parent_category_id, '-1'::integer), name)=(5662, Amazing Category 0) already exists.

GitHub

LGTM but does that display an error message to the user explaining why they can’t move that category?

It now shows the same message as when you’re renaming a category: “Category Name has already been taken”.

I think it’s fitting, since both are the same user error - trying to place two categories with the same name next to each other.