-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
5.0
Description
When a quiz slot is deleted, the slot_deleted event is currently triggered after the corresponding database record has been removed. This timing prevents event observers from accessing any information about the deleted slot (such as the question type), which is necessary for some plugins to react appropriately.
For example, certain plugins need to clear caches related to specific question types when their slots are deleted. Without access to the slot’s data at event time, these actions cannot be performed reliably.
This patch addresses the issue by adding event snapshots to the slot_deleted event using add_record_snapshot() (recommended in Event API Docs).
With these snapshots, event observers now have access to the slot’s details at the time of deletion, enabling plugins to perform necessary cleanup or updates based on the deleted slot’s properties.