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.');
  }
}
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ckng’s picture

Version: 7.x-4.0-beta2 » 7.x-4.x-dev
FileSize
2.27 KB

- added message type
- updated patch, updated api

ckng’s picture

Status: Needs review » Fixed

Committed.

  • ckng authored b65a9b7 on 7.x-4.x
    Issue #2223399 by steven.wichers, ckng: Allow modules to change the...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.