chore: Category junction cleanup on location/category delete #60
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
When a location or category is deleted, orphan rows remain in the
#__mokosuitestorelocator_location_categoriesjunction table. No cascade delete or cleanup logic exists.Fix
Either:
ON DELETE CASCADEforeign keys to the junction tableLocationTable::delete()andCategoryTable::delete()to remove junction rowsOption 1 is preferred if the DB engine supports it (InnoDB). Option 2 is the Joomla-conventional approach using Table events.
Priority
P4 — data hygiene, no user-visible impact unless junction table grows large.
Branch created:
feature/60-chore-category-junction-cleanup-on-locatFixed:
LocationTable::delete()— cleans uplocation_categoriesjunction rows wherelocation_idmatchesCategoryTable::delete()— cleans uplocation_categoriesjunction rows wherecategory_idmatches