#1581·aureuserp

Deleting a product category shows a false "deleted successfully" alongside "could not be deleted"

Author: fmoedCreated Sep 28, 2026Updated Sep 28, 2026
Labelsbug

Describe:

Deleting a product category that has only a soft-deleted product fails with "currently in use", and the list page shows a false success notification together with the error.

Root cause (verified against HEAD 9ece7f02): products_products.category_id is cascadeOnDelete, so deleting the category tries to hard-delete the trashed product, which is blocked by inventories_moves.product_id restrictOnDelete. Plus CategoriesTable swallows the QueryException without $action->failure(), so the success notification still fires.


To Reproduce:

  1. Go to 'Inventory > Configurations > Product Categories'
  2. Click on 'Delete' for a category with no visible products (verified case: category 25, trashed product 30, blocked by move 193)
  3. Observe the issue

❌ Actual Behavior

Two notifications at once: "Category deleted successfully" + "Category could not be deleted".


✅ Expected Behavior

One clear error only, no false success. Ideally naming the blocking trashed product/move.


Screenshots

Image

Additional Context

Verified via tinker: 1451 ... inventories_moves_product_id_foreign ... ON DELETE RESTRICT on delete from products_categories where id = 25. View page shows only the error (it calls $action->failure() correctly). Same catch-without-failure pattern repeats in other Tables files.