Problem

When a registered and logged in user accepts an invitation through invite/accept/%invite_by_code it receives an almost identical status message two times:

You have accepted the invitation from …
You have accepted the invitation from …

Only a period is missing from one of them. First from invite_invite_update(), then from invite_accept(), just at the end of the page callback (which invoked its own hook_invite_update()).

Proposed resolution

Two (three) possible ways to fix this …

  1. Remove the message from one of these functions.
  2. Make messages equal (period missing in one of them) and use drupal_set_message($msg, 'status', FALSE) which will omit duplicates.
  3. (Remove the message from the other function.) What function to remove from someone with more insight should decide.

I've provided two patches that solves this one or the other way. Please review.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

markus_petrux’s picture

Status: Needs review » Reviewed & tested by the community

Fix 2 works like a charm, and it looks nicer than 1. Thanks!

David_Rothstein’s picture

Fix 1 actually makes more sense to me (and is simpler), plus it seems to work fine also.

The code right above it saves the invite, and since the invite is being accepted that save should be guaranteed to trigger the code in invite_invite_update() that sets the message. Therefore setting the message in invite_accept() also should never be necessary.

ckng’s picture

Status: Reviewed & tested by the community » Fixed

3rd one should do it. Committed to dev.

  • ckng authored 59fd74e on 7.x-4.x
    Issue #2134139 by kaare, ckng: Duplicate acception messages for...

  • ckng authored b654bab on 7.x-4.x
    Issue #2134139 by kaare, ckng: Fixed missing period
    

Status: Fixed » Closed (fixed)

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