Outpost Community Demo

Drag and drop reorder categories is broken

By chmod777 ·

Tried to reorder my categories by dragging them in the admin settings. Get a "Failed to reorder categories" error every time. The UI shows the new order for a second and then snaps back.

Tried in Chrome and Firefox, same result. Clearing cache didn't help either.

Doesn't seem like a permissions thing since I can create and delete categories fine — just reordering fails.

4 replies

bugfinder404 ·

Same here. I tested this on two different communities — fails on both. Looks like it might be a backend routing issue? The error comes back immediately, doesn't seem like a timeout.

Tomasz ·

Can confirm, just reproduced it. Checked the network tab — the PUT request to is returning a 400 with an "Invalid request body" error. Seems like the request is hitting the wrong endpoint.

top-outpost-ninja ·

Found it! The /categories/reorder route was registered after /categories/{id} in the router. Gorilla mux was matching "reorder" as an {id} parameter and routing it to the update handler instead.

// Before (broken) — {id} catches "reorder"
admin.Handle("/categories/{id}", ...).Methods("PUT")
admin.Handle("/categories/reorder", ...).Methods("PUT")

// After (fixed) — literal path matches first
admin.Handle("/categories/reorder", ...).Methods("PUT")
admin.Handle("/categories/{id}", ...).Methods("PUT")

Swapped the route order so the literal /reorder path matches before the wildcard. Fix is deployed now — drag and drop should work again. ✅

chmod777 ·

Just tested — works perfectly now. Categories are reordering and saving. Thanks for the quick fix!