-
-
Notifications
You must be signed in to change notification settings - Fork 612
🐛 Reordering product categories fails when hidden categories exist #1126
Description
Describe the bug
Reordering product categories via POST /events/{event_id}/products/sort fails with "The ordered category IDs must exactly match all categories for the event without missing or extra IDs." even when all category IDs from GET /events/{event_id}/product-categories are included.
The root cause is a mismatch between the two endpoints:
GET /product-categoriesfilters out categories whereis_hidden = trueviaProductFilterService::filter()(GetProductCategoriesHandler.php)SortProductsHandlerloads all categories (including hidden) from the DB and requires an exact set match (SortProductsHandler.php#L36-L40)
Since the client never receives hidden category IDs, it's impossible to include them in the sort request.
To Reproduce
- Create an event with at least one product category where
is_hidden = true - Open the event's product management page
- Try to reorder product categories via drag & drop
- The sort request fails with the error above
Expected behavior
Reordering should succeed. Hidden categories should either be excluded from the sort handler's validation check, or the listing endpoint should expose them to organizer-facing callers.
Suggested fix
Show hidden categories in admin panel to allow reordering them (and make "hidden" mean hidden for the consumer).