Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In privatemsg.api.php, the documentation mentions hook_privatemsg_message_delete.
This doesn't appear to exist anywhere (or be called anywhere).
It would be good to see this functionality (e.g. to integrate with activity module, and so track when a message is deleted).
As deleted messages can be restored, it would be good to also have an undelete hook: hook_privatemsg_message_undelete.
Comment | File | Size | Author |
---|---|---|---|
#9 | add_delete_hook_7.patch | 4.01 KB | Berdir |
#7 | add_delete_hook2.patch | 3.22 KB | Berdir |
#6 | add_delete_hook.patch | 3.22 KB | Berdir |
#1 | 750566_add_delete_undelete_hooks.patch | 3.04 KB | manarth |
Comments
Comment #1
manarth CreditAttribution: manarth commentedThe attached patch adds delete and undelete hooks, and adds additional documentation for both.
Comment #3
BerdirWe decided to remove the hook because modules don't need to act when a message is deleted but when it is flushed and we forgot to update the documentation. But I can see that it could be of use.
However, I think this needs to be done against 2.x because new features are not allowed in 1.x.
Comment #4
Berdir#1: 750566_add_delete_undelete_hooks.patch queued for re-testing.
Comment #5
BerdirSee title. And see #1054082: Allow modules to respond to a status change..
Comment #6
BerdirAttaching a patch.
Comment #7
BerdirFixed a wrongly named variable in the patch. This passes all tests now locally, the test bot currently doesn't like Privatemsg so much.
Comment #8
BerdirCommited.
Comment #9
BerdirAttaching a patch for 7.x to run the tests on it..
Comment #10
BerdirCommited.