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.
Currently invite_accept() hard codes various redirect paths and status messages to be displayed when a user accepts an invite. There is no way for a module to change these. This patch adds a call to drupal_alter() before the end of the function.
Example implementation:
/**
* Implements hook_invite_accept_alter().
*/
function MODULE_invite_accept_alter($data) {
$invite = $data['invite'];
if (!empty($invite->data['gid']) && INVITE_VALID === $invite->status()) {
$data['redirect'] = 'node/' . $invite->data['gid'];
$data['message'] = t('Please login or register for an account to begin working on this item.');
}
}
Comment | File | Size | Author |
---|---|---|---|
#1 | invite-invite_alter-2223399-1.patch | 2.27 KB | ckng |
invite-add-drupal_alter-to-invite_accept.patch | 448 bytes | steven.wichers |
Comments
Comment #1
ckng- added message type
- updated patch, updated api
Comment #2
ckngCommitted.