Removing Campus with Event Registrations Attached Deletes Registration
Description
Tell us what you see! If you have a registration that is tied to a campus, and you delete the campus from the Rock Campus UI, the event registration will be deleted from the database.
Actual Behavior
Actual Behavior Removal of a campus has a FK ([FK_dbo.Registration_dbo.Campus_CampusId]) that will cascade delete the Registration.
Expected Behavior
Expected Behavior Rock UI will alert you that the campus is tied to an Event Registration.
Steps to Reproduce
-
Add an additional campus to Rock (Example: Second Campus)
-
Assign Second Campus to a person
-
Sign up for an event
-
Remove the campus from the person. The Registration will still say second campus as that is the campus they had when they signed up.
-
Navigate to Admin Tools => General Settings => Campus
-
Then hit the X on the Second Campus row and it will allow you to delete the campus.
-
Look at the RegistrationInstance and the Registration will be removed from the DB like it never existed.
Most of the time this is not an issue as there are People, Groups, Attendance, and Financials attached to a campus. The church cleaned up all the records so they can remove the incorrect campus. This removed about 200 Registrations, some with payment for a missions trip.
Issue Confirmation
- [x] Perform a search on the Github Issues to see if your bug is already reported.
- [x] Reproduced the problem on a fresh install or on the demo site.
Rock Version
17.5,18.0
Client Culture Setting
en-US
We will look into this and address. That said we would highly recommend that organizations not delete campuses but instead inactivate them.