Out of the box it doesn't seem like this module allows the invitee to withdraw/cancel an invite. However, if you are sent an invite you are displayed a status message to either accept or withdraw it which is a bit of a contradiction in code.

When clicking on 'withdraw' from the invitee account I get access denied along with the following status message:
The invitation has already been withdrawn

The invite status is still indeed valid and has not already been withdrawn which is 1 bug. When looking at invite_withdraw_access in invite.module the following code should be changed to remedy this message.

Change
if ($invite->status = INVITE_WITHDRAWN) {

To
if ($invite->status == INVITE_WITHDRAWN) {

To fix the access denied when trying to withdraw an invite from the invitee's account the following change should be made.

Change
if (($invite->uid == $user->uid && user_access($permission)) || user_access('administer invitations')) {

To
if ((($invite->uid == $user->uid || $invite->invitee == $user->uid) && user_access($permission)) || user_access('administer invitations')) {

Patch is attached

Comments

Sylense created an issue. See original summary.

Sylense’s picture

Title: Allow invitee to withdraw invitee (The invitation has already been withdrawn) » Allow invitee to withdraw invite (The invitation has already been withdrawn)
SpartyDan’s picture

Status: Active » Reviewed & tested by the community

The first bug is an instance where

(INVITE_WITHDRAWN = $invite->status)

would have thrown an error during development and not become a bug.

This patch, 0001-Allow-invitee-to-withdraw-invite.patch, fixes that bug.

The second bug is also fixed by this patch.

Thank you for finding and submitting a patch to fix these bugs.

Changing status to RTBC

SpartyDan’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x-4.x

  • 6a44fb5 committed on 7.x-4.x
    Issue #2632884 by Sylense: Allow invitee to withdraw invite (The...

Status: Fixed » Closed (fixed)

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