I may be going about this incorrectly, and please let me know if there is a better way, but I have a module that needs to react when a registration is being deleted. I would like to use the hook_entity_delete to make this happen but this is not currently available.
I would like to propose the following patch as a fix.
| Comment | File | Size | Author |
|---|---|---|---|
| registration-add-call-to-moduleInvoke_all.patch | 674 bytes | aaronott |
Comments
Comment #1
mgiffordPatch applies nicely. I haven't tested the functionality, but think it would be a useful addition.
Comment #2
CountPacMan commentedTested! Thanks for the patch. Will push to dev.
Comment #4
gcbUpon review, this commit has been reversed here:
http://cgit.drupalcode.org/registration/commit/?id=7ca273e
Sorry @CountPacMan, you asked me about this in person and I didn't listen closely enough.
module_invoke_all('entity_delete');is called by the entity system. It is automatically invoked for all entities, of which Registrations are one. This patch adds no new functionality, but it does result in a long spew of errors and notices.I'm curious why the original posters thought this was needed? I have tested the original code and hook_entity_delete() is invoked on direct registration deletes or on calls to delete_multiple triggered by, for example, a user with registrations being deleted.