If invite_user('delete') is deleting all invites originated by the user being deleted, it should invoke hook_invite('cancel') for those invites so that other modules have a chance to clean up.

Comments

sun’s picture

Version: 5.x-1.13 » 5.x-2.x-dev

Good catch. Could you supply a patch against 2.x?

SolomonGifford’s picture

Version: 5.x-2.x-dev » 7.x-2.x-dev
/**
 * Implements hook_user_delete().
 */
function invite_user_delete($account) {
  // Delete any invites originating from this user.
  invite_delete(array('uid' => $account->uid));

  // Clean up the notification queue.
  db_delete('invite_notifications')
    ->condition('uid', $account->uid)
    ->execute();
    
  db_update('invite')
    ->fields(array(
    	'canceled' => 1,
    ))
    ->condition('invitee', $account->uid)
    ->execute();
}
SolomonGifford’s picture

StatusFileSize
new518 bytes

A patch against the 2.X dev branch.